var $3=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var Wre=$3((Qre,P3)=>{function K3(t,e){for(var n=0;nr[a]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))r(a);new MutationObserver(a=>{for(const i of a)if(i.type==="childList")for(const s of i.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(a){const i={};return a.integrity&&(i.integrity=a.integrity),a.referrerPolicy&&(i.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?i.credentials="include":a.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(a){if(a.ep)return;a.ep=!0;const i=n(a);fetch(a.href,i)}})();var Wu=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function yC(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var EC={exports:{}},A0={},bC={exports:{}},$e={};/** * @license React * react.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var $d=Symbol.for("react.element"),J3=Symbol.for("react.portal"),Y3=Symbol.for("react.fragment"),X3=Symbol.for("react.strict_mode"),Q3=Symbol.for("react.profiler"),Z3=Symbol.for("react.provider"),eM=Symbol.for("react.context"),tM=Symbol.for("react.forward_ref"),nM=Symbol.for("react.suspense"),rM=Symbol.for("react.memo"),aM=Symbol.for("react.lazy"),gx=Symbol.iterator;function iM(t){return t===null||typeof t!="object"?null:(t=gx&&t[gx]||t["@@iterator"],typeof t=="function"?t:null)}var xC={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},SC=Object.assign,TC={};function cu(t,e,n){this.props=t,this.context=e,this.refs=TC,this.updater=n||xC}cu.prototype.isReactComponent={};cu.prototype.setState=function(t,e){if(typeof t!="object"&&typeof t!="function"&&t!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,t,e,"setState")};cu.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function wC(){}wC.prototype=cu.prototype;function N_(t,e,n){this.props=t,this.context=e,this.refs=TC,this.updater=n||xC}var O_=N_.prototype=new wC;O_.constructor=N_;SC(O_,cu.prototype);O_.isPureReactComponent=!0;var vx=Array.isArray,CC=Object.prototype.hasOwnProperty,M_={current:null},AC={key:!0,ref:!0,__self:!0,__source:!0};function IC(t,e,n){var r,a={},i=null,s=null;if(e!=null)for(r in e.ref!==void 0&&(s=e.ref),e.key!==void 0&&(i=""+e.key),e)CC.call(e,r)&&!AC.hasOwnProperty(r)&&(a[r]=e[r]);var o=arguments.length-2;if(o===1)a.children=n;else if(1>>1,V=le[De];if(0>>1;Dea(z,we))rea(_e,z)?(le[De]=_e,le[re]=we,De=re):(le[De]=z,le[q]=we,De=q);else if(rea(_e,we))le[De]=_e,le[re]=we,De=re;else break e}}return ye}function a(le,ye){var we=le.sortIndex-ye.sortIndex;return we!==0?we:le.id-ye.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;t.unstable_now=function(){return i.now()}}else{var s=Date,o=s.now();t.unstable_now=function(){return s.now()-o}}var l=[],u=[],c=1,h=null,f=3,p=!1,g=!1,m=!1,_=typeof setTimeout=="function"?setTimeout:null,x=typeof clearTimeout=="function"?clearTimeout:null,E=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function y(le){for(var ye=n(u);ye!==null;){if(ye.callback===null)r(u);else if(ye.startTime<=le)r(u),ye.sortIndex=ye.expirationTime,e(l,ye);else break;ye=n(u)}}function I(le){if(m=!1,y(le),!g)if(n(l)!==null)g=!0,ft(j);else{var ye=n(u);ye!==null&&Ue(I,ye.startTime-le)}}function j(le,ye){g=!1,m&&(m=!1,x(S),S=-1),p=!0;var we=f;try{for(y(ye),h=n(l);h!==null&&(!(h.expirationTime>ye)||le&&!R());){var De=h.callback;if(typeof De=="function"){h.callback=null,f=h.priorityLevel;var V=De(h.expirationTime<=ye);ye=t.unstable_now(),typeof V=="function"?h.callback=V:h===n(l)&&r(l),y(ye)}else r(l);h=n(l)}if(h!==null)var H=!0;else{var q=n(u);q!==null&&Ue(I,q.startTime-ye),H=!1}return H}finally{h=null,f=we,p=!1}}var G=!1,T=null,S=-1,w=5,A=-1;function R(){return!(t.unstable_now()-Ale||125De?(le.sortIndex=we,e(u,le),n(l)===null&&le===n(u)&&(m?(x(S),S=-1):m=!0,Ue(I,we-De))):(le.sortIndex=V,e(l,le),g||p||(g=!0,ft(j))),le},t.unstable_shouldYield=R,t.unstable_wrapCallback=function(le){var ye=f;return function(){var we=f;f=ye;try{return le.apply(this,arguments)}finally{f=we}}}})(OC);NC.exports=OC;var vM=NC.exports;/** * @license React * react-dom.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var _M=X,Pr=vM;function oe(t){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+t,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Tv=Object.prototype.hasOwnProperty,yM=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,yx={},Ex={};function EM(t){return Tv.call(Ex,t)?!0:Tv.call(yx,t)?!1:yM.test(t)?Ex[t]=!0:(yx[t]=!0,!1)}function bM(t,e,n,r){if(n!==null&&n.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function xM(t,e,n,r){if(e===null||typeof e>"u"||bM(t,e,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function Qn(t,e,n,r,a,i,s){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=r,this.attributeNamespace=a,this.mustUseProperty=n,this.propertyName=t,this.type=e,this.sanitizeURL=i,this.removeEmptyString=s}var An={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){An[t]=new Qn(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];An[e]=new Qn(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){An[t]=new Qn(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){An[t]=new Qn(t,2,!1,t,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(t){An[t]=new Qn(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){An[t]=new Qn(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){An[t]=new Qn(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){An[t]=new Qn(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){An[t]=new Qn(t,5,!1,t.toLowerCase(),null,!1,!1)});var D_=/[\-:]([a-z])/g;function F_(t){return t[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(t){var e=t.replace(D_,F_);An[e]=new Qn(e,1,!1,t,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(t){var e=t.replace(D_,F_);An[e]=new Qn(e,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(t){var e=t.replace(D_,F_);An[e]=new Qn(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){An[t]=new Qn(t,1,!1,t.toLowerCase(),null,!1,!1)});An.xlinkHref=new Qn("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){An[t]=new Qn(t,1,!1,t.toLowerCase(),null,!0,!0)});function B_(t,e,n,r){var a=An.hasOwnProperty(e)?An[e]:null;(a!==null?a.type!==0:r||!(2o||a[s]!==i[o]){var l=` `+a[s].replace(" at new "," at ");return t.displayName&&l.includes("")&&(l=l.replace("",t.displayName)),l}while(1<=s&&0<=o);break}}}finally{rg=!1,Error.prepareStackTrace=n}return(t=t?t.displayName||t.name:"")?lc(t):""}function SM(t){switch(t.tag){case 5:return lc(t.type);case 16:return lc("Lazy");case 13:return lc("Suspense");case 19:return lc("SuspenseList");case 0:case 2:case 15:return t=ag(t.type,!1),t;case 11:return t=ag(t.type.render,!1),t;case 1:return t=ag(t.type,!0),t;default:return""}}function Iv(t){if(t==null)return null;if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case ol:return"Fragment";case sl:return"Portal";case wv:return"Profiler";case U_:return"StrictMode";case Cv:return"Suspense";case Av:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case DC:return(t.displayName||"Context")+".Consumer";case LC:return(t._context.displayName||"Context")+".Provider";case V_:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case j_:return e=t.displayName||null,e!==null?e:Iv(t.type)||"Memo";case Ni:e=t._payload,t=t._init;try{return Iv(t(e))}catch{}}return null}function TM(t){var e=t.type;switch(t.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return t=e.render,t=t.displayName||t.name||"",e.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Iv(e);case 8:return e===U_?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function us(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function BC(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function wM(t){var e=BC(t)?"checked":"value",n=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),r=""+t[e];if(!t.hasOwnProperty(e)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var a=n.get,i=n.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return a.call(this)},set:function(s){r=""+s,i.call(this,s)}}),Object.defineProperty(t,e,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(s){r=""+s},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function Hh(t){t._valueTracker||(t._valueTracker=wM(t))}function UC(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var n=e.getValue(),r="";return t&&(r=BC(t)?t.checked?"true":"false":t.value),t=r,t!==n?(e.setValue(t),!0):!1}function np(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function Pv(t,e){var n=e.checked;return Ot({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??t._wrapperState.initialChecked})}function xx(t,e){var n=e.defaultValue==null?"":e.defaultValue,r=e.checked!=null?e.checked:e.defaultChecked;n=us(e.value!=null?e.value:n),t._wrapperState={initialChecked:r,initialValue:n,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function VC(t,e){e=e.checked,e!=null&&B_(t,"checked",e,!1)}function Rv(t,e){VC(t,e);var n=us(e.value),r=e.type;if(n!=null)r==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+n):t.value!==""+n&&(t.value=""+n);else if(r==="submit"||r==="reset"){t.removeAttribute("value");return}e.hasOwnProperty("value")?kv(t,e.type,n):e.hasOwnProperty("defaultValue")&&kv(t,e.type,us(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function Sx(t,e,n){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var r=e.type;if(!(r!=="submit"&&r!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+t._wrapperState.initialValue,n||e===t.value||(t.value=e),t.defaultValue=e}n=t.name,n!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,n!==""&&(t.name=n)}function kv(t,e,n){(e!=="number"||np(t.ownerDocument)!==t)&&(n==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+n&&(t.defaultValue=""+n))}var uc=Array.isArray;function Tl(t,e,n,r){if(t=t.options,e){e={};for(var a=0;a"+e.valueOf().toString()+"",e=Wh.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function Yc(t,e){if(e){var n=t.firstChild;if(n&&n===t.lastChild&&n.nodeType===3){n.nodeValue=e;return}}t.textContent=e}var bc={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},CM=["Webkit","ms","Moz","O"];Object.keys(bc).forEach(function(t){CM.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),bc[e]=bc[t]})});function GC(t,e,n){return e==null||typeof e=="boolean"||e===""?"":n||typeof e!="number"||e===0||bc.hasOwnProperty(t)&&bc[t]?(""+e).trim():e+"px"}function HC(t,e){t=t.style;for(var n in e)if(e.hasOwnProperty(n)){var r=n.indexOf("--")===0,a=GC(n,e[n],r);n==="float"&&(n="cssFloat"),r?t.setProperty(n,a):t[n]=a}}var AM=Ot({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Mv(t,e){if(e){if(AM[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(oe(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(oe(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(oe(61))}if(e.style!=null&&typeof e.style!="object")throw Error(oe(62))}}function Lv(t,e){if(t.indexOf("-")===-1)return typeof e.is=="string";switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Dv=null;function z_(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var Fv=null,wl=null,Cl=null;function Cx(t){if(t=Yd(t)){if(typeof Fv!="function")throw Error(oe(280));var e=t.stateNode;e&&(e=N0(e),Fv(t.stateNode,t.type,e))}}function WC(t){wl?Cl?Cl.push(t):Cl=[t]:wl=t}function $C(){if(wl){var t=wl,e=Cl;if(Cl=wl=null,Cx(t),e)for(t=0;t>>=0,t===0?32:31-(BM(t)/UM|0)|0}var $h=64,Kh=4194304;function cc(t){switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return t&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function sp(t,e){var n=t.pendingLanes;if(n===0)return 0;var r=0,a=t.suspendedLanes,i=t.pingedLanes,s=n&268435455;if(s!==0){var o=s&~a;o!==0?r=cc(o):(i&=s,i!==0&&(r=cc(i)))}else s=n&~a,s!==0?r=cc(s):i!==0&&(r=cc(i));if(r===0)return 0;if(e!==0&&e!==r&&!(e&a)&&(a=r&-r,i=e&-e,a>=i||a===16&&(i&4194240)!==0))return e;if(r&4&&(r|=n&16),e=t.entangledLanes,e!==0)for(t=t.entanglements,e&=r;0n;n++)e.push(t);return e}function Kd(t,e,n){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-aa(e),t[e]=n}function qM(t,e){var n=t.pendingLanes&~e;t.pendingLanes=e,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=e,t.mutableReadLanes&=e,t.entangledLanes&=e,e=t.entanglements;var r=t.eventTimes;for(t=t.expirationTimes;0=Sc),Lx=" ",Dx=!1;function fA(t,e){switch(t){case"keyup":return vL.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function pA(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var ll=!1;function yL(t,e){switch(t){case"compositionend":return pA(e);case"keypress":return e.which!==32?null:(Dx=!0,Lx);case"textInput":return t=e.data,t===Lx&&Dx?null:t;default:return null}}function EL(t,e){if(ll)return t==="compositionend"||!Y_&&fA(t,e)?(t=dA(),kf=$_=Vi=null,ll=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1=e)return{node:n,offset:e-t};t=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Vx(n)}}function _A(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?_A(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function yA(){for(var t=window,e=np();e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string"}catch{n=!1}if(n)t=e.contentWindow;else break;e=np(t.document)}return e}function X_(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}function PL(t){var e=yA(),n=t.focusedElem,r=t.selectionRange;if(e!==n&&n&&n.ownerDocument&&_A(n.ownerDocument.documentElement,n)){if(r!==null&&X_(n)){if(e=r.start,t=r.end,t===void 0&&(t=e),"selectionStart"in n)n.selectionStart=e,n.selectionEnd=Math.min(t,n.value.length);else if(t=(e=n.ownerDocument||document)&&e.defaultView||window,t.getSelection){t=t.getSelection();var a=n.textContent.length,i=Math.min(r.start,a);r=r.end===void 0?i:Math.min(r.end,a),!t.extend&&i>r&&(a=r,r=i,i=a),a=jx(n,i);var s=jx(n,r);a&&s&&(t.rangeCount!==1||t.anchorNode!==a.node||t.anchorOffset!==a.offset||t.focusNode!==s.node||t.focusOffset!==s.offset)&&(e=e.createRange(),e.setStart(a.node,a.offset),t.removeAllRanges(),i>r?(t.addRange(e),t.extend(s.node,s.offset)):(e.setEnd(s.node,s.offset),t.addRange(e)))}}for(e=[],t=n;t=t.parentNode;)t.nodeType===1&&e.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,ul=null,qv=null,wc=null,Gv=!1;function zx(t,e,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Gv||ul==null||ul!==np(r)||(r=ul,"selectionStart"in r&&X_(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),wc&&nd(wc,r)||(wc=r,r=up(qv,"onSelect"),0hl||(t.current=Yv[hl],Yv[hl]=null,hl--)}function yt(t,e){hl++,Yv[hl]=t.current,t.current=e}var cs={},jn=Cs(cs),rr=Cs(!1),ho=cs;function zl(t,e){var n=t.type.contextTypes;if(!n)return cs;var r=t.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===e)return r.__reactInternalMemoizedMaskedChildContext;var a={},i;for(i in n)a[i]=e[i];return r&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=a),a}function ar(t){return t=t.childContextTypes,t!=null}function dp(){Tt(rr),Tt(jn)}function Jx(t,e,n){if(jn.current!==cs)throw Error(oe(168));yt(jn,e),yt(rr,n)}function IA(t,e,n){var r=t.stateNode;if(e=e.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var a in r)if(!(a in e))throw Error(oe(108,TM(t)||"Unknown",a));return Ot({},n,r)}function hp(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||cs,ho=jn.current,yt(jn,t),yt(rr,rr.current),!0}function Yx(t,e,n){var r=t.stateNode;if(!r)throw Error(oe(169));n?(t=IA(t,e,ho),r.__reactInternalMemoizedMergedChildContext=t,Tt(rr),Tt(jn),yt(jn,t)):Tt(rr),yt(rr,n)}var Ga=null,O0=!1,_g=!1;function PA(t){Ga===null?Ga=[t]:Ga.push(t)}function jL(t){O0=!0,PA(t)}function As(){if(!_g&&Ga!==null){_g=!0;var t=0,e=dt;try{var n=Ga;for(dt=1;t>=s,a-=s,Ha=1<<32-aa(e)+a|n<S?(w=T,T=null):w=T.sibling;var A=f(x,T,y[S],I);if(A===null){T===null&&(T=w);break}t&&T&&A.alternate===null&&e(x,T),E=i(A,E,S),G===null?j=A:G.sibling=A,G=A,T=w}if(S===y.length)return n(x,T),It&&Vs(x,S),j;if(T===null){for(;SS?(w=T,T=null):w=T.sibling;var R=f(x,T,A.value,I);if(R===null){T===null&&(T=w);break}t&&T&&R.alternate===null&&e(x,T),E=i(R,E,S),G===null?j=R:G.sibling=R,G=R,T=w}if(A.done)return n(x,T),It&&Vs(x,S),j;if(T===null){for(;!A.done;S++,A=y.next())A=h(x,A.value,I),A!==null&&(E=i(A,E,S),G===null?j=A:G.sibling=A,G=A);return It&&Vs(x,S),j}for(T=r(x,T);!A.done;S++,A=y.next())A=p(T,x,S,A.value,I),A!==null&&(t&&A.alternate!==null&&T.delete(A.key===null?S:A.key),E=i(A,E,S),G===null?j=A:G.sibling=A,G=A);return t&&T.forEach(function(L){return e(x,L)}),It&&Vs(x,S),j}function _(x,E,y,I){if(typeof y=="object"&&y!==null&&y.type===ol&&y.key===null&&(y=y.props.children),typeof y=="object"&&y!==null){switch(y.$$typeof){case Gh:e:{for(var j=y.key,G=E;G!==null;){if(G.key===j){if(j=y.type,j===ol){if(G.tag===7){n(x,G.sibling),E=a(G,y.props.children),E.return=x,x=E;break e}}else if(G.elementType===j||typeof j=="object"&&j!==null&&j.$$typeof===Ni&&Zx(j)===G.type){n(x,G.sibling),E=a(G,y.props),E.ref=Qu(x,G,y),E.return=x,x=E;break e}n(x,G);break}else e(x,G);G=G.sibling}y.type===ol?(E=to(y.props.children,x.mode,I,y.key),E.return=x,x=E):(I=Uf(y.type,y.key,y.props,null,x.mode,I),I.ref=Qu(x,E,y),I.return=x,x=I)}return s(x);case sl:e:{for(G=y.key;E!==null;){if(E.key===G)if(E.tag===4&&E.stateNode.containerInfo===y.containerInfo&&E.stateNode.implementation===y.implementation){n(x,E.sibling),E=a(E,y.children||[]),E.return=x,x=E;break e}else{n(x,E);break}else e(x,E);E=E.sibling}E=Cg(y,x.mode,I),E.return=x,x=E}return s(x);case Ni:return G=y._init,_(x,E,G(y._payload),I)}if(uc(y))return g(x,E,y,I);if($u(y))return m(x,E,y,I);tf(x,y)}return typeof y=="string"&&y!==""||typeof y=="number"?(y=""+y,E!==null&&E.tag===6?(n(x,E.sibling),E=a(E,y),E.return=x,x=E):(n(x,E),E=wg(y,x.mode,I),E.return=x,x=E),s(x)):n(x,E)}return _}var Gl=OA(!0),MA=OA(!1),mp=Cs(null),gp=null,ml=null,ty=null;function ny(){ty=ml=gp=null}function ry(t){var e=mp.current;Tt(mp),t._currentValue=e}function Zv(t,e,n){for(;t!==null;){var r=t.alternate;if((t.childLanes&e)!==e?(t.childLanes|=e,r!==null&&(r.childLanes|=e)):r!==null&&(r.childLanes&e)!==e&&(r.childLanes|=e),t===n)break;t=t.return}}function Il(t,e){gp=t,ty=ml=null,t=t.dependencies,t!==null&&t.firstContext!==null&&(t.lanes&e&&(nr=!0),t.firstContext=null)}function zr(t){var e=t._currentValue;if(ty!==t)if(t={context:t,memoizedValue:e,next:null},ml===null){if(gp===null)throw Error(oe(308));ml=t,gp.dependencies={lanes:0,firstContext:t}}else ml=ml.next=t;return e}var Ks=null;function ay(t){Ks===null?Ks=[t]:Ks.push(t)}function LA(t,e,n,r){var a=e.interleaved;return a===null?(n.next=n,ay(e)):(n.next=a.next,a.next=n),e.interleaved=n,si(t,r)}function si(t,e){t.lanes|=e;var n=t.alternate;for(n!==null&&(n.lanes|=e),n=t,t=t.return;t!==null;)t.childLanes|=e,n=t.alternate,n!==null&&(n.childLanes|=e),n=t,t=t.return;return n.tag===3?n.stateNode:null}var Oi=!1;function iy(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function DA(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,effects:t.effects})}function Qa(t,e){return{eventTime:t,lane:e,tag:0,payload:null,callback:null,next:null}}function Zi(t,e,n){var r=t.updateQueue;if(r===null)return null;if(r=r.shared,et&2){var a=r.pending;return a===null?e.next=e:(e.next=a.next,a.next=e),r.pending=e,si(t,n)}return a=r.interleaved,a===null?(e.next=e,ay(r)):(e.next=a.next,a.next=e),r.interleaved=e,si(t,n)}function Of(t,e,n){if(e=e.updateQueue,e!==null&&(e=e.shared,(n&4194240)!==0)){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,G_(t,n)}}function eS(t,e){var n=t.updateQueue,r=t.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var a=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var s={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};i===null?a=i=s:i=i.next=s,n=n.next}while(n!==null);i===null?a=i=e:i=i.next=e}else a=i=e;n={baseState:r.baseState,firstBaseUpdate:a,lastBaseUpdate:i,shared:r.shared,effects:r.effects},t.updateQueue=n;return}t=n.lastBaseUpdate,t===null?n.firstBaseUpdate=e:t.next=e,n.lastBaseUpdate=e}function vp(t,e,n,r){var a=t.updateQueue;Oi=!1;var i=a.firstBaseUpdate,s=a.lastBaseUpdate,o=a.shared.pending;if(o!==null){a.shared.pending=null;var l=o,u=l.next;l.next=null,s===null?i=u:s.next=u,s=l;var c=t.alternate;c!==null&&(c=c.updateQueue,o=c.lastBaseUpdate,o!==s&&(o===null?c.firstBaseUpdate=u:o.next=u,c.lastBaseUpdate=l))}if(i!==null){var h=a.baseState;s=0,c=u=l=null,o=i;do{var f=o.lane,p=o.eventTime;if((r&f)===f){c!==null&&(c=c.next={eventTime:p,lane:0,tag:o.tag,payload:o.payload,callback:o.callback,next:null});e:{var g=t,m=o;switch(f=e,p=n,m.tag){case 1:if(g=m.payload,typeof g=="function"){h=g.call(p,h,f);break e}h=g;break e;case 3:g.flags=g.flags&-65537|128;case 0:if(g=m.payload,f=typeof g=="function"?g.call(p,h,f):g,f==null)break e;h=Ot({},h,f);break e;case 2:Oi=!0}}o.callback!==null&&o.lane!==0&&(t.flags|=64,f=a.effects,f===null?a.effects=[o]:f.push(o))}else p={eventTime:p,lane:f,tag:o.tag,payload:o.payload,callback:o.callback,next:null},c===null?(u=c=p,l=h):c=c.next=p,s|=f;if(o=o.next,o===null){if(o=a.shared.pending,o===null)break;f=o,o=f.next,f.next=null,a.lastBaseUpdate=f,a.shared.pending=null}}while(!0);if(c===null&&(l=h),a.baseState=l,a.firstBaseUpdate=u,a.lastBaseUpdate=c,e=a.shared.interleaved,e!==null){a=e;do s|=a.lane,a=a.next;while(a!==e)}else i===null&&(a.shared.lanes=0);mo|=s,t.lanes=s,t.memoizedState=h}}function tS(t,e,n){if(t=e.effects,e.effects=null,t!==null)for(e=0;en?n:4,t(!0);var r=Eg.transition;Eg.transition={};try{t(!1),e()}finally{dt=n,Eg.transition=r}}function ZA(){return qr().memoizedState}function HL(t,e,n){var r=ts(t);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},eI(t))tI(e,n);else if(n=LA(t,e,n,r),n!==null){var a=Jn();ia(n,t,r,a),nI(n,e,r)}}function WL(t,e,n){var r=ts(t),a={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(eI(t))tI(e,a);else{var i=t.alternate;if(t.lanes===0&&(i===null||i.lanes===0)&&(i=e.lastRenderedReducer,i!==null))try{var s=e.lastRenderedState,o=i(s,n);if(a.hasEagerState=!0,a.eagerState=o,la(o,s)){var l=e.interleaved;l===null?(a.next=a,ay(e)):(a.next=l.next,l.next=a),e.interleaved=a;return}}catch{}finally{}n=LA(t,e,a,r),n!==null&&(a=Jn(),ia(n,t,r,a),nI(n,e,r))}}function eI(t){var e=t.alternate;return t===Nt||e!==null&&e===Nt}function tI(t,e){Cc=yp=!0;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function nI(t,e,n){if(n&4194240){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,G_(t,n)}}var Ep={readContext:zr,useCallback:Nn,useContext:Nn,useEffect:Nn,useImperativeHandle:Nn,useInsertionEffect:Nn,useLayoutEffect:Nn,useMemo:Nn,useReducer:Nn,useRef:Nn,useState:Nn,useDebugValue:Nn,useDeferredValue:Nn,useTransition:Nn,useMutableSource:Nn,useSyncExternalStore:Nn,useId:Nn,unstable_isNewReconciler:!1},$L={readContext:zr,useCallback:function(t,e){return va().memoizedState=[t,e===void 0?null:e],t},useContext:zr,useEffect:rS,useImperativeHandle:function(t,e,n){return n=n!=null?n.concat([t]):null,Lf(4194308,4,KA.bind(null,e,t),n)},useLayoutEffect:function(t,e){return Lf(4194308,4,t,e)},useInsertionEffect:function(t,e){return Lf(4,2,t,e)},useMemo:function(t,e){var n=va();return e=e===void 0?null:e,t=t(),n.memoizedState=[t,e],t},useReducer:function(t,e,n){var r=va();return e=n!==void 0?n(e):e,r.memoizedState=r.baseState=e,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:e},r.queue=t,t=t.dispatch=HL.bind(null,Nt,t),[r.memoizedState,t]},useRef:function(t){var e=va();return t={current:t},e.memoizedState=t},useState:nS,useDebugValue:fy,useDeferredValue:function(t){return va().memoizedState=t},useTransition:function(){var t=nS(!1),e=t[0];return t=GL.bind(null,t[1]),va().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,n){var r=Nt,a=va();if(It){if(n===void 0)throw Error(oe(407));n=n()}else{if(n=e(),fn===null)throw Error(oe(349));po&30||VA(r,e,n)}a.memoizedState=n;var i={value:n,getSnapshot:e};return a.queue=i,rS(zA.bind(null,r,i,t),[t]),r.flags|=2048,cd(9,jA.bind(null,r,i,n,e),void 0,null),n},useId:function(){var t=va(),e=fn.identifierPrefix;if(It){var n=Wa,r=Ha;n=(r&~(1<<32-aa(r)-1)).toString(32)+n,e=":"+e+"R"+n,n=ld++,0<\/script>",t=t.removeChild(t.firstChild)):typeof r.is=="string"?t=s.createElement(n,{is:r.is}):(t=s.createElement(n),n==="select"&&(s=t,r.multiple?s.multiple=!0:r.size&&(s.size=r.size))):t=s.createElementNS(t,n),t[ya]=e,t[id]=r,hI(t,e,!1,!1),e.stateNode=t;e:{switch(s=Lv(n,r),n){case"dialog":xt("cancel",t),xt("close",t),a=r;break;case"iframe":case"object":case"embed":xt("load",t),a=r;break;case"video":case"audio":for(a=0;a$l&&(e.flags|=128,r=!0,Zu(i,!1),e.lanes=4194304)}else{if(!r)if(t=_p(s),t!==null){if(e.flags|=128,r=!0,n=t.updateQueue,n!==null&&(e.updateQueue=n,e.flags|=4),Zu(i,!0),i.tail===null&&i.tailMode==="hidden"&&!s.alternate&&!It)return On(e),null}else 2*Vt()-i.renderingStartTime>$l&&n!==1073741824&&(e.flags|=128,r=!0,Zu(i,!1),e.lanes=4194304);i.isBackwards?(s.sibling=e.child,e.child=s):(n=i.last,n!==null?n.sibling=s:e.child=s,i.last=s)}return i.tail!==null?(e=i.tail,i.rendering=e,i.tail=e.sibling,i.renderingStartTime=Vt(),e.sibling=null,n=Rt.current,yt(Rt,r?n&1|2:n&1),e):(On(e),null);case 22:case 23:return yy(),r=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==r&&(e.flags|=8192),r&&e.mode&1?vr&1073741824&&(On(e),e.subtreeFlags&6&&(e.flags|=8192)):On(e),null;case 24:return null;case 25:return null}throw Error(oe(156,e.tag))}function tD(t,e){switch(Z_(e),e.tag){case 1:return ar(e.type)&&dp(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return Hl(),Tt(rr),Tt(jn),ly(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return oy(e),null;case 13:if(Tt(Rt),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(oe(340));ql()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return Tt(Rt),null;case 4:return Hl(),null;case 10:return ry(e.type._context),null;case 22:case 23:return yy(),null;case 24:return null;default:return null}}var rf=!1,Dn=!1,nD=typeof WeakSet=="function"?WeakSet:Set,be=null;function gl(t,e){var n=t.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Lt(t,e,r)}else n.current=null}function l1(t,e,n){try{n()}catch(r){Lt(t,e,r)}}var pS=!1;function rD(t,e){if(Hv=op,t=yA(),X_(t)){if("selectionStart"in t)var n={start:t.selectionStart,end:t.selectionEnd};else e:{n=(n=t.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var a=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var s=0,o=-1,l=-1,u=0,c=0,h=t,f=null;t:for(;;){for(var p;h!==n||a!==0&&h.nodeType!==3||(o=s+a),h!==i||r!==0&&h.nodeType!==3||(l=s+r),h.nodeType===3&&(s+=h.nodeValue.length),(p=h.firstChild)!==null;)f=h,h=p;for(;;){if(h===t)break t;if(f===n&&++u===a&&(o=s),f===i&&++c===r&&(l=s),(p=h.nextSibling)!==null)break;h=f,f=h.parentNode}h=p}n=o===-1||l===-1?null:{start:o,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(Wv={focusedElem:t,selectionRange:n},op=!1,be=e;be!==null;)if(e=be,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,be=t;else for(;be!==null;){e=be;try{var g=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(g!==null){var m=g.memoizedProps,_=g.memoizedState,x=e.stateNode,E=x.getSnapshotBeforeUpdate(e.elementType===e.type?m:Yr(e.type,m),_);x.__reactInternalSnapshotBeforeUpdate=E}break;case 3:var y=e.stateNode.containerInfo;y.nodeType===1?y.textContent="":y.nodeType===9&&y.documentElement&&y.removeChild(y.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(oe(163))}}catch(I){Lt(e,e.return,I)}if(t=e.sibling,t!==null){t.return=e.return,be=t;break}be=e.return}return g=pS,pS=!1,g}function Ac(t,e,n){var r=e.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var a=r=r.next;do{if((a.tag&t)===t){var i=a.destroy;a.destroy=void 0,i!==void 0&&l1(e,n,i)}a=a.next}while(a!==r)}}function D0(t,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var n=e=e.next;do{if((n.tag&t)===t){var r=n.create;n.destroy=r()}n=n.next}while(n!==e)}}function u1(t){var e=t.ref;if(e!==null){var n=t.stateNode;switch(t.tag){case 5:t=n;break;default:t=n}typeof e=="function"?e(t):e.current=t}}function mI(t){var e=t.alternate;e!==null&&(t.alternate=null,mI(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[ya],delete e[id],delete e[Jv],delete e[UL],delete e[VL])),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function gI(t){return t.tag===5||t.tag===3||t.tag===4}function mS(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||gI(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function c1(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.nodeType===8?n.parentNode.insertBefore(t,e):n.insertBefore(t,e):(n.nodeType===8?(e=n.parentNode,e.insertBefore(t,n)):(e=n,e.appendChild(t)),n=n._reactRootContainer,n!=null||e.onclick!==null||(e.onclick=cp));else if(r!==4&&(t=t.child,t!==null))for(c1(t,e,n),t=t.sibling;t!==null;)c1(t,e,n),t=t.sibling}function d1(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.insertBefore(t,e):n.appendChild(t);else if(r!==4&&(t=t.child,t!==null))for(d1(t,e,n),t=t.sibling;t!==null;)d1(t,e,n),t=t.sibling}var yn=null,Xr=!1;function Ai(t,e,n){for(n=n.child;n!==null;)vI(t,e,n),n=n.sibling}function vI(t,e,n){if(Ta&&typeof Ta.onCommitFiberUnmount=="function")try{Ta.onCommitFiberUnmount(I0,n)}catch{}switch(n.tag){case 5:Dn||gl(n,e);case 6:var r=yn,a=Xr;yn=null,Ai(t,e,n),yn=r,Xr=a,yn!==null&&(Xr?(t=yn,n=n.stateNode,t.nodeType===8?t.parentNode.removeChild(n):t.removeChild(n)):yn.removeChild(n.stateNode));break;case 18:yn!==null&&(Xr?(t=yn,n=n.stateNode,t.nodeType===8?vg(t.parentNode,n):t.nodeType===1&&vg(t,n),ed(t)):vg(yn,n.stateNode));break;case 4:r=yn,a=Xr,yn=n.stateNode.containerInfo,Xr=!0,Ai(t,e,n),yn=r,Xr=a;break;case 0:case 11:case 14:case 15:if(!Dn&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){a=r=r.next;do{var i=a,s=i.destroy;i=i.tag,s!==void 0&&(i&2||i&4)&&l1(n,e,s),a=a.next}while(a!==r)}Ai(t,e,n);break;case 1:if(!Dn&&(gl(n,e),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(o){Lt(n,e,o)}Ai(t,e,n);break;case 21:Ai(t,e,n);break;case 22:n.mode&1?(Dn=(r=Dn)||n.memoizedState!==null,Ai(t,e,n),Dn=r):Ai(t,e,n);break;default:Ai(t,e,n)}}function gS(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var n=t.stateNode;n===null&&(n=t.stateNode=new nD),e.forEach(function(r){var a=hD.bind(null,t,r);n.has(r)||(n.add(r),r.then(a,a))})}}function $r(t,e){var n=e.deletions;if(n!==null)for(var r=0;ra&&(a=s),r&=~i}if(r=a,r=Vt()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*iD(r/1960))-r,10t?16:t,ji===null)var r=!1;else{if(t=ji,ji=null,Sp=0,et&6)throw Error(oe(331));var a=et;for(et|=4,be=t.current;be!==null;){var i=be,s=i.child;if(be.flags&16){var o=i.deletions;if(o!==null){for(var l=0;lVt()-vy?eo(t,0):gy|=n),ir(t,e)}function wI(t,e){e===0&&(t.mode&1?(e=Kh,Kh<<=1,!(Kh&130023424)&&(Kh=4194304)):e=1);var n=Jn();t=si(t,e),t!==null&&(Kd(t,e,n),ir(t,n))}function dD(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),wI(t,n)}function hD(t,e){var n=0;switch(t.tag){case 13:var r=t.stateNode,a=t.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=t.stateNode;break;default:throw Error(oe(314))}r!==null&&r.delete(e),wI(t,n)}var CI;CI=function(t,e,n){if(t!==null)if(t.memoizedProps!==e.pendingProps||rr.current)nr=!0;else{if(!(t.lanes&n)&&!(e.flags&128))return nr=!1,ZL(t,e,n);nr=!!(t.flags&131072)}else nr=!1,It&&e.flags&1048576&&RA(e,pp,e.index);switch(e.lanes=0,e.tag){case 2:var r=e.type;Df(t,e),t=e.pendingProps;var a=zl(e,jn.current);Il(e,n),a=cy(null,e,r,t,a,n);var i=dy();return e.flags|=1,typeof a=="object"&&a!==null&&typeof a.render=="function"&&a.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,ar(r)?(i=!0,hp(e)):i=!1,e.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,iy(e),a.updater=L0,e.stateNode=a,a._reactInternals=e,t1(e,r,t,n),e=a1(null,e,r,!0,i,n)):(e.tag=0,It&&i&&Q_(e),qn(null,e,a,n),e=e.child),e;case 16:r=e.elementType;e:{switch(Df(t,e),t=e.pendingProps,a=r._init,r=a(r._payload),e.type=r,a=e.tag=pD(r),t=Yr(r,t),a){case 0:e=r1(null,e,r,t,n);break e;case 1:e=dS(null,e,r,t,n);break e;case 11:e=uS(null,e,r,t,n);break e;case 14:e=cS(null,e,r,Yr(r.type,t),n);break e}throw Error(oe(306,r,""))}return e;case 0:return r=e.type,a=e.pendingProps,a=e.elementType===r?a:Yr(r,a),r1(t,e,r,a,n);case 1:return r=e.type,a=e.pendingProps,a=e.elementType===r?a:Yr(r,a),dS(t,e,r,a,n);case 3:e:{if(uI(e),t===null)throw Error(oe(387));r=e.pendingProps,i=e.memoizedState,a=i.element,DA(t,e),vp(e,r,null,n);var s=e.memoizedState;if(r=s.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},e.updateQueue.baseState=i,e.memoizedState=i,e.flags&256){a=Wl(Error(oe(423)),e),e=hS(t,e,r,n,a);break e}else if(r!==a){a=Wl(Error(oe(424)),e),e=hS(t,e,r,n,a);break e}else for(xr=Qi(e.stateNode.containerInfo.firstChild),Tr=e,It=!0,Qr=null,n=MA(e,null,r,n),e.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(ql(),r===a){e=oi(t,e,n);break e}qn(t,e,r,n)}e=e.child}return e;case 5:return FA(e),t===null&&Qv(e),r=e.type,a=e.pendingProps,i=t!==null?t.memoizedProps:null,s=a.children,$v(r,a)?s=null:i!==null&&$v(r,i)&&(e.flags|=32),lI(t,e),qn(t,e,s,n),e.child;case 6:return t===null&&Qv(e),null;case 13:return cI(t,e,n);case 4:return sy(e,e.stateNode.containerInfo),r=e.pendingProps,t===null?e.child=Gl(e,null,r,n):qn(t,e,r,n),e.child;case 11:return r=e.type,a=e.pendingProps,a=e.elementType===r?a:Yr(r,a),uS(t,e,r,a,n);case 7:return qn(t,e,e.pendingProps,n),e.child;case 8:return qn(t,e,e.pendingProps.children,n),e.child;case 12:return qn(t,e,e.pendingProps.children,n),e.child;case 10:e:{if(r=e.type._context,a=e.pendingProps,i=e.memoizedProps,s=a.value,yt(mp,r._currentValue),r._currentValue=s,i!==null)if(la(i.value,s)){if(i.children===a.children&&!rr.current){e=oi(t,e,n);break e}}else for(i=e.child,i!==null&&(i.return=e);i!==null;){var o=i.dependencies;if(o!==null){s=i.child;for(var l=o.firstContext;l!==null;){if(l.context===r){if(i.tag===1){l=Qa(-1,n&-n),l.tag=2;var u=i.updateQueue;if(u!==null){u=u.shared;var c=u.pending;c===null?l.next=l:(l.next=c.next,c.next=l),u.pending=l}}i.lanes|=n,l=i.alternate,l!==null&&(l.lanes|=n),Zv(i.return,n,e),o.lanes|=n;break}l=l.next}}else if(i.tag===10)s=i.type===e.type?null:i.child;else if(i.tag===18){if(s=i.return,s===null)throw Error(oe(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),Zv(s,n,e),s=i.sibling}else s=i.child;if(s!==null)s.return=i;else for(s=i;s!==null;){if(s===e){s=null;break}if(i=s.sibling,i!==null){i.return=s.return,s=i;break}s=s.return}i=s}qn(t,e,a.children,n),e=e.child}return e;case 9:return a=e.type,r=e.pendingProps.children,Il(e,n),a=zr(a),r=r(a),e.flags|=1,qn(t,e,r,n),e.child;case 14:return r=e.type,a=Yr(r,e.pendingProps),a=Yr(r.type,a),cS(t,e,r,a,n);case 15:return sI(t,e,e.type,e.pendingProps,n);case 17:return r=e.type,a=e.pendingProps,a=e.elementType===r?a:Yr(r,a),Df(t,e),e.tag=1,ar(r)?(t=!0,hp(e)):t=!1,Il(e,n),rI(e,r,a),t1(e,r,a,n),a1(null,e,r,!0,t,n);case 19:return dI(t,e,n);case 22:return oI(t,e,n)}throw Error(oe(156,e.tag))};function AI(t,e){return eA(t,e)}function fD(t,e,n,r){this.tag=t,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Vr(t,e,n,r){return new fD(t,e,n,r)}function by(t){return t=t.prototype,!(!t||!t.isReactComponent)}function pD(t){if(typeof t=="function")return by(t)?1:0;if(t!=null){if(t=t.$$typeof,t===V_)return 11;if(t===j_)return 14}return 2}function ns(t,e){var n=t.alternate;return n===null?(n=Vr(t.tag,e,t.key,t.mode),n.elementType=t.elementType,n.type=t.type,n.stateNode=t.stateNode,n.alternate=t,t.alternate=n):(n.pendingProps=e,n.type=t.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=t.flags&14680064,n.childLanes=t.childLanes,n.lanes=t.lanes,n.child=t.child,n.memoizedProps=t.memoizedProps,n.memoizedState=t.memoizedState,n.updateQueue=t.updateQueue,e=t.dependencies,n.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},n.sibling=t.sibling,n.index=t.index,n.ref=t.ref,n}function Uf(t,e,n,r,a,i){var s=2;if(r=t,typeof t=="function")by(t)&&(s=1);else if(typeof t=="string")s=5;else e:switch(t){case ol:return to(n.children,a,i,e);case U_:s=8,a|=8;break;case wv:return t=Vr(12,n,e,a|2),t.elementType=wv,t.lanes=i,t;case Cv:return t=Vr(13,n,e,a),t.elementType=Cv,t.lanes=i,t;case Av:return t=Vr(19,n,e,a),t.elementType=Av,t.lanes=i,t;case FC:return B0(n,a,i,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case LC:s=10;break e;case DC:s=9;break e;case V_:s=11;break e;case j_:s=14;break e;case Ni:s=16,r=null;break e}throw Error(oe(130,t==null?t:typeof t,""))}return e=Vr(s,n,e,a),e.elementType=t,e.type=r,e.lanes=i,e}function to(t,e,n,r){return t=Vr(7,t,r,e),t.lanes=n,t}function B0(t,e,n,r){return t=Vr(22,t,r,e),t.elementType=FC,t.lanes=n,t.stateNode={isHidden:!1},t}function wg(t,e,n){return t=Vr(6,t,null,e),t.lanes=n,t}function Cg(t,e,n){return e=Vr(4,t.children!==null?t.children:[],t.key,e),e.lanes=n,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function mD(t,e,n,r,a){this.tag=e,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=sg(0),this.expirationTimes=sg(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=sg(0),this.identifierPrefix=r,this.onRecoverableError=a,this.mutableSourceEagerHydrationData=null}function xy(t,e,n,r,a,i,s,o,l){return t=new mD(t,e,n,o,l),e===1?(e=1,i===!0&&(e|=8)):e=0,i=Vr(3,null,null,e),t.current=i,i.stateNode=t,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},iy(i),t}function gD(t,e,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(kI)}catch(t){console.error(t)}}kI(),kC.exports=kr;var bD=kC.exports,NI,TS=bD;NI=TS.createRoot,TS.hydrateRoot;/** * @remix-run/router v1.19.0 * * Copyright (c) Remix Software Inc. * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT */function hd(){return hd=Object.assign?Object.assign.bind():function(t){for(var e=1;e"u")throw new Error(e)}function OI(t,e){if(!t){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function SD(){return Math.random().toString(36).substr(2,8)}function CS(t,e){return{usr:t.state,key:t.key,idx:e}}function g1(t,e,n,r){return n===void 0&&(n=null),hd({pathname:typeof t=="string"?t:t.pathname,search:"",hash:""},typeof e=="string"?fu(e):e,{state:n,key:e&&e.key||r||SD()})}function Cp(t){let{pathname:e="/",search:n="",hash:r=""}=t;return n&&n!=="?"&&(e+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(e+=r.charAt(0)==="#"?r:"#"+r),e}function fu(t){let e={};if(t){let n=t.indexOf("#");n>=0&&(e.hash=t.substr(n),t=t.substr(0,n));let r=t.indexOf("?");r>=0&&(e.search=t.substr(r),t=t.substr(0,r)),t&&(e.pathname=t)}return e}function TD(t,e,n,r){r===void 0&&(r={});let{window:a=document.defaultView,v5Compat:i=!1}=r,s=a.history,o=zi.Pop,l=null,u=c();u==null&&(u=0,s.replaceState(hd({},s.state,{idx:u}),""));function c(){return(s.state||{idx:null}).idx}function h(){o=zi.Pop;let _=c(),x=_==null?null:_-u;u=_,l&&l({action:o,location:m.location,delta:x})}function f(_,x){o=zi.Push;let E=g1(m.location,_,x);u=c()+1;let y=CS(E,u),I=m.createHref(E);try{s.pushState(y,"",I)}catch(j){if(j instanceof DOMException&&j.name==="DataCloneError")throw j;a.location.assign(I)}i&&l&&l({action:o,location:m.location,delta:1})}function p(_,x){o=zi.Replace;let E=g1(m.location,_,x);u=c();let y=CS(E,u),I=m.createHref(E);s.replaceState(y,"",I),i&&l&&l({action:o,location:m.location,delta:0})}function g(_){let x=a.location.origin!=="null"?a.location.origin:a.location.href,E=typeof _=="string"?_:Cp(_);return E=E.replace(/ $/,"%20"),Wt(x,"No window.location.(origin|href) available to create URL for href: "+E),new URL(E,x)}let m={get action(){return o},get location(){return t(a,s)},listen(_){if(l)throw new Error("A history only accepts one active listener");return a.addEventListener(wS,h),l=_,()=>{a.removeEventListener(wS,h),l=null}},createHref(_){return e(a,_)},createURL:g,encodeLocation(_){let x=g(_);return{pathname:x.pathname,search:x.search,hash:x.hash}},push:f,replace:p,go(_){return s.go(_)}};return m}var AS;(function(t){t.data="data",t.deferred="deferred",t.redirect="redirect",t.error="error"})(AS||(AS={}));function wD(t,e,n){return n===void 0&&(n="/"),CD(t,e,n,!1)}function CD(t,e,n,r){let a=typeof e=="string"?fu(e):e,i=Cy(a.pathname||"/",n);if(i==null)return null;let s=MI(t);AD(s);let o=null;for(let l=0;o==null&&l{let l={relativePath:o===void 0?i.path||"":o,caseSensitive:i.caseSensitive===!0,childrenIndex:s,route:i};l.relativePath.startsWith("/")&&(Wt(l.relativePath.startsWith(r),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(r.length));let u=rs([r,l.relativePath]),c=n.concat(l);i.children&&i.children.length>0&&(Wt(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),MI(i.children,e,c,u)),!(i.path==null&&!i.index)&&e.push({path:u,score:MD(u,i.index),routesMeta:c})};return t.forEach((i,s)=>{var o;if(i.path===""||!((o=i.path)!=null&&o.includes("?")))a(i,s);else for(let l of LI(i.path))a(i,s,l)}),e}function LI(t){let e=t.split("/");if(e.length===0)return[];let[n,...r]=e,a=n.endsWith("?"),i=n.replace(/\?$/,"");if(r.length===0)return a?[i,""]:[i];let s=LI(r.join("/")),o=[];return o.push(...s.map(l=>l===""?i:[i,l].join("/"))),a&&o.push(...s),o.map(l=>t.startsWith("/")&&l===""?"/":l)}function AD(t){t.sort((e,n)=>e.score!==n.score?n.score-e.score:LD(e.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const ID=/^:[\w-]+$/,PD=3,RD=2,kD=1,ND=10,OD=-2,IS=t=>t==="*";function MD(t,e){let n=t.split("/"),r=n.length;return n.some(IS)&&(r+=OD),e&&(r+=RD),n.filter(a=>!IS(a)).reduce((a,i)=>a+(ID.test(i)?PD:i===""?kD:ND),r)}function LD(t,e){return t.length===e.length&&t.slice(0,-1).every((r,a)=>r===e[a])?t[t.length-1]-e[e.length-1]:0}function DD(t,e,n){let{routesMeta:r}=t,a={},i="/",s=[];for(let o=0;o{let{paramName:f,isOptional:p}=c;if(f==="*"){let m=o[h]||"";s=i.slice(0,i.length-m.length).replace(/(.)\/+$/,"$1")}const g=o[h];return p&&!g?u[f]=void 0:u[f]=(g||"").replace(/%2F/g,"/"),u},{}),pathname:i,pathnameBase:s,pattern:t}}function FD(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!0),OI(t==="*"||!t.endsWith("*")||t.endsWith("/*"),'Route path "'+t+'" will be treated as if it were '+('"'+t.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+t.replace(/\*$/,"/*")+'".'));let r=[],a="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(s,o,l)=>(r.push({paramName:o,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return t.endsWith("*")?(r.push({paramName:"*"}),a+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?a+="\\/*$":t!==""&&t!=="/"&&(a+="(?:(?=\\/|$))"),[new RegExp(a,e?void 0:"i"),r]}function BD(t){try{return t.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return OI(!1,'The URL path "'+t+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+e+").")),t}}function Cy(t,e){if(e==="/")return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let n=e.endsWith("/")?e.length-1:e.length,r=t.charAt(n);return r&&r!=="/"?null:t.slice(n)||"/"}function UD(t,e){e===void 0&&(e="/");let{pathname:n,search:r="",hash:a=""}=typeof t=="string"?fu(t):t;return{pathname:n?n.startsWith("/")?n:VD(n,e):e,search:qD(r),hash:GD(a)}}function VD(t,e){let n=e.replace(/\/+$/,"").split("/");return t.split("/").forEach(a=>{a===".."?n.length>1&&n.pop():a!=="."&&n.push(a)}),n.length>1?n.join("/"):"/"}function Ag(t,e,n,r){return"Cannot include a '"+t+"' character in a manually specified "+("`to."+e+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function jD(t){return t.filter((e,n)=>n===0||e.route.path&&e.route.path.length>0)}function DI(t,e){let n=jD(t);return e?n.map((r,a)=>a===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function FI(t,e,n,r){r===void 0&&(r=!1);let a;typeof t=="string"?a=fu(t):(a=hd({},t),Wt(!a.pathname||!a.pathname.includes("?"),Ag("?","pathname","search",a)),Wt(!a.pathname||!a.pathname.includes("#"),Ag("#","pathname","hash",a)),Wt(!a.search||!a.search.includes("#"),Ag("#","search","hash",a)));let i=t===""||a.pathname==="",s=i?"/":a.pathname,o;if(s==null)o=n;else{let h=e.length-1;if(!r&&s.startsWith("..")){let f=s.split("/");for(;f[0]==="..";)f.shift(),h-=1;a.pathname=f.join("/")}o=h>=0?e[h]:"/"}let l=UD(a,o),u=s&&s!=="/"&&s.endsWith("/"),c=(i||s===".")&&n.endsWith("/");return!l.pathname.endsWith("/")&&(u||c)&&(l.pathname+="/"),l}const rs=t=>t.join("/").replace(/\/\/+/g,"/"),zD=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),qD=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,GD=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t;function HD(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}const BI=["post","put","patch","delete"];new Set(BI);const WD=["get",...BI];new Set(WD);/** * React Router v6.26.0 * * Copyright (c) Remix Software Inc. * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT */function fd(){return fd=Object.assign?Object.assign.bind():function(t){for(var e=1;e{o.current=!0}),X.useCallback(function(u,c){if(c===void 0&&(c={}),!o.current)return;if(typeof u=="number"){r.go(u);return}let h=FI(u,JSON.parse(s),i,c.relative==="path");t==null&&e!=="/"&&(h.pathname=h.pathname==="/"?e:rs([e,h.pathname])),(c.replace?r.replace:r.push)(h,c.state,c)},[e,r,s,i,t])}function Zd(){let{matches:t}=X.useContext(Is),e=t[t.length-1];return e?e.params:{}}function jI(t,e){let{relative:n}=e===void 0?{}:e,{future:r}=X.useContext(Mo),{matches:a}=X.useContext(Is),{pathname:i}=da(),s=JSON.stringify(DI(a,r.v7_relativeSplatPath));return X.useMemo(()=>FI(t,JSON.parse(s),i,n==="path"),[t,s,i,n])}function YD(t,e){return XD(t,e)}function XD(t,e,n,r){Qd()||Wt(!1);let{navigator:a}=X.useContext(Mo),{matches:i}=X.useContext(Is),s=i[i.length-1],o=s?s.params:{};s&&s.pathname;let l=s?s.pathnameBase:"/";s&&s.route;let u=da(),c;if(e){var h;let _=typeof e=="string"?fu(e):e;l==="/"||(h=_.pathname)!=null&&h.startsWith(l)||Wt(!1),c=_}else c=u;let f=c.pathname||"/",p=f;if(l!=="/"){let _=l.replace(/^\//,"").split("/");p="/"+f.replace(/^\//,"").split("/").slice(_.length).join("/")}let g=wD(t,{pathname:p}),m=nF(g&&g.map(_=>Object.assign({},_,{params:Object.assign({},o,_.params),pathname:rs([l,a.encodeLocation?a.encodeLocation(_.pathname).pathname:_.pathname]),pathnameBase:_.pathnameBase==="/"?l:rs([l,a.encodeLocation?a.encodeLocation(_.pathnameBase).pathname:_.pathnameBase])})),i,n,r);return e&&m?X.createElement(q0.Provider,{value:{location:fd({pathname:"/",search:"",hash:"",state:null,key:"default"},c),navigationType:zi.Pop}},m):m}function QD(){let t=sF(),e=HD(t)?t.status+" "+t.statusText:t instanceof Error?t.message:JSON.stringify(t),n=t instanceof Error?t.stack:null,a={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return X.createElement(X.Fragment,null,X.createElement("h2",null,"Unexpected Application Error!"),X.createElement("h3",{style:{fontStyle:"italic"}},e),n?X.createElement("pre",{style:a},n):null,null)}const ZD=X.createElement(QD,null);class eF extends X.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,n){return n.location!==e.location||n.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:n.error,location:n.location,revalidation:e.revalidation||n.revalidation}}componentDidCatch(e,n){console.error("React Router caught the following error during render",e,n)}render(){return this.state.error!==void 0?X.createElement(Is.Provider,{value:this.props.routeContext},X.createElement(UI.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function tF(t){let{routeContext:e,match:n,children:r}=t,a=X.useContext(Ay);return a&&a.static&&a.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=n.route.id),X.createElement(Is.Provider,{value:e},r)}function nF(t,e,n,r){var a;if(e===void 0&&(e=[]),n===void 0&&(n=null),r===void 0&&(r=null),t==null){var i;if(!n)return null;if(n.errors)t=n.matches;else if((i=r)!=null&&i.v7_partialHydration&&e.length===0&&!n.initialized&&n.matches.length>0)t=n.matches;else return null}let s=t,o=(a=n)==null?void 0:a.errors;if(o!=null){let c=s.findIndex(h=>h.route.id&&(o==null?void 0:o[h.route.id])!==void 0);c>=0||Wt(!1),s=s.slice(0,Math.min(s.length,c+1))}let l=!1,u=-1;if(n&&r&&r.v7_partialHydration)for(let c=0;c=0?s=s.slice(0,u+1):s=[s[0]];break}}}return s.reduceRight((c,h,f)=>{let p,g=!1,m=null,_=null;n&&(p=o&&h.route.id?o[h.route.id]:void 0,m=h.route.errorElement||ZD,l&&(u<0&&f===0?(g=!0,_=null):u===f&&(g=!0,_=h.route.hydrateFallbackElement||null)));let x=e.concat(s.slice(0,f+1)),E=()=>{let y;return p?y=m:g?y=_:h.route.Component?y=X.createElement(h.route.Component,null):h.route.element?y=h.route.element:y=c,X.createElement(tF,{match:h,routeContext:{outlet:c,matches:x,isDataRoute:n!=null},children:y})};return n&&(h.route.ErrorBoundary||h.route.errorElement||f===0)?X.createElement(eF,{location:n.location,revalidation:n.revalidation,component:m,error:p,children:E(),routeContext:{outlet:null,matches:x,isDataRoute:!0}}):E()},null)}var zI=function(t){return t.UseBlocker="useBlocker",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t}(zI||{}),Ap=function(t){return t.UseBlocker="useBlocker",t.UseLoaderData="useLoaderData",t.UseActionData="useActionData",t.UseRouteError="useRouteError",t.UseNavigation="useNavigation",t.UseRouteLoaderData="useRouteLoaderData",t.UseMatches="useMatches",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t.UseRouteId="useRouteId",t}(Ap||{});function rF(t){let e=X.useContext(Ay);return e||Wt(!1),e}function aF(t){let e=X.useContext($D);return e||Wt(!1),e}function iF(t){let e=X.useContext(Is);return e||Wt(!1),e}function qI(t){let e=iF(),n=e.matches[e.matches.length-1];return n.route.id||Wt(!1),n.route.id}function sF(){var t;let e=X.useContext(UI),n=aF(Ap.UseRouteError),r=qI(Ap.UseRouteError);return e!==void 0?e:(t=n.errors)==null?void 0:t[r]}function oF(){let{router:t}=rF(zI.UseNavigateStable),e=qI(Ap.UseNavigateStable),n=X.useRef(!1);return VI(()=>{n.current=!0}),X.useCallback(function(a,i){i===void 0&&(i={}),n.current&&(typeof a=="number"?t.navigate(a):t.navigate(a,fd({fromRouteId:e},i)))},[t,e])}function za(t){Wt(!1)}function lF(t){let{basename:e="/",children:n=null,location:r,navigationType:a=zi.Pop,navigator:i,static:s=!1,future:o}=t;Qd()&&Wt(!1);let l=e.replace(/^\/*/,"/"),u=X.useMemo(()=>({basename:l,navigator:i,static:s,future:fd({v7_relativeSplatPath:!1},o)}),[l,o,i,s]);typeof r=="string"&&(r=fu(r));let{pathname:c="/",search:h="",hash:f="",state:p=null,key:g="default"}=r,m=X.useMemo(()=>{let _=Cy(c,l);return _==null?null:{location:{pathname:_,search:h,hash:f,state:p,key:g},navigationType:a}},[l,c,h,f,p,g,a]);return m==null?null:X.createElement(Mo.Provider,{value:u},X.createElement(q0.Provider,{children:n,value:m}))}function uF(t){let{children:e,location:n}=t;return YD(v1(e),n)}new Promise(()=>{});function v1(t,e){e===void 0&&(e=[]);let n=[];return X.Children.forEach(t,(r,a)=>{if(!X.isValidElement(r))return;let i=[...e,a];if(r.type===X.Fragment){n.push.apply(n,v1(r.props.children,i));return}r.type!==za&&Wt(!1),!r.props.index||!r.props.children||Wt(!1);let s={id:r.props.id||i.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(s.children=v1(r.props.children,i)),n.push(s)}),n}/** * React Router DOM v6.26.0 * * Copyright (c) Remix Software Inc. * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT */function _1(){return _1=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&(n[a]=t[a]);return n}function dF(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function hF(t,e){return t.button===0&&(!e||e==="_self")&&!dF(t)}const fF=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","unstable_viewTransition"],pF="6";try{window.__reactRouterVersion=pF}catch{}const mF="startTransition",RS=cM[mF];function gF(t){let{basename:e,children:n,future:r,window:a}=t,i=X.useRef();i.current==null&&(i.current=xD({window:a,v5Compat:!0}));let s=i.current,[o,l]=X.useState({action:s.action,location:s.location}),{v7_startTransition:u}=r||{},c=X.useCallback(h=>{u&&RS?RS(()=>l(h)):l(h)},[l,u]);return X.useLayoutEffect(()=>s.listen(c),[s,c]),X.createElement(lF,{basename:e,children:n,location:o.location,navigationType:o.action,navigator:s,future:r})}const vF=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",_F=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Kl=X.forwardRef(function(e,n){let{onClick:r,relative:a,reloadDocument:i,replace:s,state:o,target:l,to:u,preventScrollReset:c,unstable_viewTransition:h}=e,f=cF(e,fF),{basename:p}=X.useContext(Mo),g,m=!1;if(typeof u=="string"&&_F.test(u)&&(g=u,vF))try{let y=new URL(window.location.href),I=u.startsWith("//")?new URL(y.protocol+u):new URL(u),j=Cy(I.pathname,p);I.origin===y.origin&&j!=null?u=j+I.search+I.hash:m=!0}catch{}let _=KD(u,{relative:a}),x=yF(u,{replace:s,state:o,target:l,preventScrollReset:c,relative:a,unstable_viewTransition:h});function E(y){r&&r(y),y.defaultPrevented||x(y)}return X.createElement("a",_1({},f,{href:g||_,onClick:m||i?r:E,ref:n,target:l}))});var kS;(function(t){t.UseScrollRestoration="useScrollRestoration",t.UseSubmit="useSubmit",t.UseSubmitFetcher="useSubmitFetcher",t.UseFetcher="useFetcher",t.useViewTransitionState="useViewTransitionState"})(kS||(kS={}));var NS;(function(t){t.UseFetcher="useFetcher",t.UseFetchers="useFetchers",t.UseScrollRestoration="useScrollRestoration"})(NS||(NS={}));function yF(t,e){let{target:n,replace:r,state:a,preventScrollReset:i,relative:s,unstable_viewTransition:o}=e===void 0?{}:e,l=G0(),u=da(),c=jI(t,{relative:s});return X.useCallback(h=>{if(hF(h,n)){h.preventDefault();let f=r!==void 0?r:Cp(u)===Cp(c);l(t,{replace:f,state:a,preventScrollReset:i,relative:s,unstable_viewTransition:o})}},[u,l,c,r,a,n,t,i,s,o])}var OS={};/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const GI={NODE_CLIENT:!1,NODE_ADMIN:!1,SDK_VERSION:"${JSCORE_VERSION}"};/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const ce=function(t,e){if(!t)throw pu(e)},pu=function(t){return new Error("Firebase Database ("+GI.SDK_VERSION+") INTERNAL ASSERT FAILED: "+t)};/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const HI=function(t){const e=[];let n=0;for(let r=0;r>6|192,e[n++]=a&63|128):(a&64512)===55296&&r+1>18|240,e[n++]=a>>12&63|128,e[n++]=a>>6&63|128,e[n++]=a&63|128):(e[n++]=a>>12|224,e[n++]=a>>6&63|128,e[n++]=a&63|128)}return e},EF=function(t){const e=[];let n=0,r=0;for(;n191&&a<224){const i=t[n++];e[r++]=String.fromCharCode((a&31)<<6|i&63)}else if(a>239&&a<365){const i=t[n++],s=t[n++],o=t[n++],l=((a&7)<<18|(i&63)<<12|(s&63)<<6|o&63)-65536;e[r++]=String.fromCharCode(55296+(l>>10)),e[r++]=String.fromCharCode(56320+(l&1023))}else{const i=t[n++],s=t[n++];e[r++]=String.fromCharCode((a&15)<<12|(i&63)<<6|s&63)}}return e.join("")},Iy={byteToCharMap_:null,charToByteMap_:null,byteToCharMapWebSafe_:null,charToByteMapWebSafe_:null,ENCODED_VALS_BASE:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",get ENCODED_VALS(){return this.ENCODED_VALS_BASE+"+/="},get ENCODED_VALS_WEBSAFE(){return this.ENCODED_VALS_BASE+"-_."},HAS_NATIVE_SUPPORT:typeof atob=="function",encodeByteArray(t,e){if(!Array.isArray(t))throw Error("encodeByteArray takes an array as a parameter");this.init_();const n=e?this.byteToCharMapWebSafe_:this.byteToCharMap_,r=[];for(let a=0;a>2,h=(i&3)<<4|o>>4;let f=(o&15)<<2|u>>6,p=u&63;l||(p=64,s||(f=64)),r.push(n[c],n[h],n[f],n[p])}return r.join("")},encodeString(t,e){return this.HAS_NATIVE_SUPPORT&&!e?btoa(t):this.encodeByteArray(HI(t),e)},decodeString(t,e){return this.HAS_NATIVE_SUPPORT&&!e?atob(t):EF(this.decodeStringToByteArray(t,e))},decodeStringToByteArray(t,e){this.init_();const n=e?this.charToByteMapWebSafe_:this.charToByteMap_,r=[];for(let a=0;a>4;if(r.push(f),u!==64){const p=o<<4&240|u>>2;if(r.push(p),h!==64){const g=u<<6&192|h;r.push(g)}}}return r},init_(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(let t=0;t=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(t)]=t,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(t)]=t)}}};class bF extends Error{constructor(){super(...arguments),this.name="DecodeBase64StringError"}}const WI=function(t){const e=HI(t);return Iy.encodeByteArray(e,!0)},Ip=function(t){return WI(t).replace(/\./g,"")},Pp=function(t){try{return Iy.decodeString(t,!0)}catch(e){console.error("base64Decode failed: ",e)}return null};/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function xF(t){return $I(void 0,t)}function $I(t,e){if(!(e instanceof Object))return e;switch(e.constructor){case Date:const n=e;return new Date(n.getTime());case Object:t===void 0&&(t={});break;case Array:t=[];break;default:return e}for(const n in e)!e.hasOwnProperty(n)||!SF(n)||(t[n]=$I(t[n],e[n]));return t}function SF(t){return t!=="__proto__"}/** * @license * Copyright 2022 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function TF(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("Unable to locate global object.")}/** * @license * Copyright 2022 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const wF=()=>TF().__FIREBASE_DEFAULTS__,CF=()=>{if(typeof process>"u"||typeof OS>"u")return;const t=OS.__FIREBASE_DEFAULTS__;if(t)return JSON.parse(t)},AF=()=>{if(typeof document>"u")return;let t;try{t=document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/)}catch{return}const e=t&&Pp(t[1]);return e&&JSON.parse(e)},H0=()=>{try{return wF()||CF()||AF()}catch(t){console.info(`Unable to get __FIREBASE_DEFAULTS__ due to: ${t}`);return}},KI=t=>{var e,n;return(n=(e=H0())===null||e===void 0?void 0:e.emulatorHosts)===null||n===void 0?void 0:n[t]},JI=t=>{const e=KI(t);if(!e)return;const n=e.lastIndexOf(":");if(n<=0||n+1===e.length)throw new Error(`Invalid host ${e} with no separate hostname and port!`);const r=parseInt(e.substring(n+1),10);return e[0]==="["?[e.substring(1,n-1),r]:[e.substring(0,n),r]},YI=()=>{var t;return(t=H0())===null||t===void 0?void 0:t.config},XI=t=>{var e;return(e=H0())===null||e===void 0?void 0:e[`_${t}`]};/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class W0{constructor(){this.reject=()=>{},this.resolve=()=>{},this.promise=new Promise((e,n)=>{this.resolve=e,this.reject=n})}wrapCallback(e){return(n,r)=>{n?this.reject(n):this.resolve(r),typeof e=="function"&&(this.promise.catch(()=>{}),e.length===1?e(n):e(n,r))}}}/** * @license * Copyright 2021 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function QI(t,e){if(t.uid)throw new Error('The "uid" field is no longer supported by mockUserToken. Please use "sub" instead for Firebase Auth User ID.');const n={alg:"none",type:"JWT"},r=e||"demo-project",a=t.iat||0,i=t.sub||t.user_id;if(!i)throw new Error("mockUserToken must contain 'sub' or 'user_id' field!");const s=Object.assign({iss:`https://securetoken.google.com/${r}`,aud:r,iat:a,exp:a+3600,auth_time:a,sub:i,user_id:i,firebase:{sign_in_provider:"custom",identities:{}}},t);return[Ip(JSON.stringify(n)),Ip(JSON.stringify(s)),""].join(".")}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function zn(){return typeof navigator<"u"&&typeof navigator.userAgent=="string"?navigator.userAgent:""}function Py(){return typeof window<"u"&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(zn())}function IF(){var t;const e=(t=H0())===null||t===void 0?void 0:t.forceEnvironment;if(e==="node")return!0;if(e==="browser")return!1;try{return Object.prototype.toString.call(global.process)==="[object process]"}catch{return!1}}function PF(){const t=typeof chrome=="object"?chrome.runtime:typeof browser=="object"?browser.runtime:void 0;return typeof t=="object"&&t.id!==void 0}function ZI(){return typeof navigator=="object"&&navigator.product==="ReactNative"}function RF(){const t=zn();return t.indexOf("MSIE ")>=0||t.indexOf("Trident/")>=0}function eP(){return GI.NODE_ADMIN===!0}function kF(){return!IF()&&!!navigator.userAgent&&navigator.userAgent.includes("Safari")&&!navigator.userAgent.includes("Chrome")}function NF(){try{return typeof indexedDB=="object"}catch{return!1}}function OF(){return new Promise((t,e)=>{try{let n=!0;const r="validate-browser-context-for-indexeddb-analytics-module",a=self.indexedDB.open(r);a.onsuccess=()=>{a.result.close(),n||self.indexedDB.deleteDatabase(r),t(!0)},a.onupgradeneeded=()=>{n=!1},a.onerror=()=>{var i;e(((i=a.error)===null||i===void 0?void 0:i.message)||"")}}catch(n){e(n)}})}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const MF="FirebaseError";class vi extends Error{constructor(e,n,r){super(n),this.code=e,this.customData=r,this.name=MF,Object.setPrototypeOf(this,vi.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,eh.prototype.create)}}class eh{constructor(e,n,r){this.service=e,this.serviceName=n,this.errors=r}create(e,...n){const r=n[0]||{},a=`${this.service}/${e}`,i=this.errors[e],s=i?LF(i,r):"Error",o=`${this.serviceName}: ${s} (${a}).`;return new vi(a,o,r)}}function LF(t,e){return t.replace(DF,(n,r)=>{const a=e[r];return a!=null?String(a):`<${r}?>`})}const DF=/\{\$([^}]+)}/g;/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function pd(t){return JSON.parse(t)}function tn(t){return JSON.stringify(t)}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const tP=function(t){let e={},n={},r={},a="";try{const i=t.split(".");e=pd(Pp(i[0])||""),n=pd(Pp(i[1])||""),a=i[2],r=n.d||{},delete n.d}catch{}return{header:e,claims:n,data:r,signature:a}},FF=function(t){const e=tP(t),n=e.claims;return!!n&&typeof n=="object"&&n.hasOwnProperty("iat")},BF=function(t){const e=tP(t).claims;return typeof e=="object"&&e.admin===!0};/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function La(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function Jl(t,e){if(Object.prototype.hasOwnProperty.call(t,e))return t[e]}function y1(t){for(const e in t)if(Object.prototype.hasOwnProperty.call(t,e))return!1;return!0}function Rp(t,e,n){const r={};for(const a in t)Object.prototype.hasOwnProperty.call(t,a)&&(r[a]=e.call(n,t[a],a,t));return r}function kp(t,e){if(t===e)return!0;const n=Object.keys(t),r=Object.keys(e);for(const a of n){if(!r.includes(a))return!1;const i=t[a],s=e[a];if(MS(i)&&MS(s)){if(!kp(i,s))return!1}else if(i!==s)return!1}for(const a of r)if(!n.includes(a))return!1;return!0}function MS(t){return t!==null&&typeof t=="object"}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function mu(t){const e=[];for(const[n,r]of Object.entries(t))Array.isArray(r)?r.forEach(a=>{e.push(encodeURIComponent(n)+"="+encodeURIComponent(a))}):e.push(encodeURIComponent(n)+"="+encodeURIComponent(r));return e.length?"&"+e.join("&"):""}function hc(t){const e={};return t.replace(/^\?/,"").split("&").forEach(r=>{if(r){const[a,i]=r.split("=");e[decodeURIComponent(a)]=decodeURIComponent(i)}}),e}function fc(t){const e=t.indexOf("?");if(!e)return"";const n=t.indexOf("#",e);return t.substring(e,n>0?n:void 0)}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class UF{constructor(){this.chain_=[],this.buf_=[],this.W_=[],this.pad_=[],this.inbuf_=0,this.total_=0,this.blockSize=512/8,this.pad_[0]=128;for(let e=1;e>>31)&4294967295}let a=this.chain_[0],i=this.chain_[1],s=this.chain_[2],o=this.chain_[3],l=this.chain_[4],u,c;for(let h=0;h<80;h++){h<40?h<20?(u=o^i&(s^o),c=1518500249):(u=i^s^o,c=1859775393):h<60?(u=i&s|o&(i|s),c=2400959708):(u=i^s^o,c=3395469782);const f=(a<<5|a>>>27)+u+l+c+r[h]&4294967295;l=o,o=s,s=(i<<30|i>>>2)&4294967295,i=a,a=f}this.chain_[0]=this.chain_[0]+a&4294967295,this.chain_[1]=this.chain_[1]+i&4294967295,this.chain_[2]=this.chain_[2]+s&4294967295,this.chain_[3]=this.chain_[3]+o&4294967295,this.chain_[4]=this.chain_[4]+l&4294967295}update(e,n){if(e==null)return;n===void 0&&(n=e.length);const r=n-this.blockSize;let a=0;const i=this.buf_;let s=this.inbuf_;for(;a=56;a--)this.buf_[a]=n&255,n/=256;this.compress_(this.buf_);let r=0;for(let a=0;a<5;a++)for(let i=24;i>=0;i-=8)e[r]=this.chain_[a]>>i&255,++r;return e}}function VF(t,e){const n=new jF(t,e);return n.subscribe.bind(n)}class jF{constructor(e,n){this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Promise.resolve(),this.finalized=!1,this.onNoObservers=n,this.task.then(()=>{e(this)}).catch(r=>{this.error(r)})}next(e){this.forEachObserver(n=>{n.next(e)})}error(e){this.forEachObserver(n=>{n.error(e)}),this.close(e)}complete(){this.forEachObserver(e=>{e.complete()}),this.close()}subscribe(e,n,r){let a;if(e===void 0&&n===void 0&&r===void 0)throw new Error("Missing Observer.");zF(e,["next","error","complete"])?a=e:a={next:e,error:n,complete:r},a.next===void 0&&(a.next=Ig),a.error===void 0&&(a.error=Ig),a.complete===void 0&&(a.complete=Ig);const i=this.unsubscribeOne.bind(this,this.observers.length);return this.finalized&&this.task.then(()=>{try{this.finalError?a.error(this.finalError):a.complete()}catch{}}),this.observers.push(a),i}unsubscribeOne(e){this.observers===void 0||this.observers[e]===void 0||(delete this.observers[e],this.observerCount-=1,this.observerCount===0&&this.onNoObservers!==void 0&&this.onNoObservers(this))}forEachObserver(e){if(!this.finalized)for(let n=0;n{if(this.observers!==void 0&&this.observers[e]!==void 0)try{n(this.observers[e])}catch(r){typeof console<"u"&&console.error&&console.error(r)}})}close(e){this.finalized||(this.finalized=!0,e!==void 0&&(this.finalError=e),this.task.then(()=>{this.observers=void 0,this.onNoObservers=void 0}))}}function zF(t,e){if(typeof t!="object"||t===null)return!1;for(const n of e)if(n in t&&typeof t[n]=="function")return!0;return!1}function Ig(){}function Ry(t,e){return`${t} failed: ${e} argument `}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const qF=function(t){const e=[];let n=0;for(let r=0;r=55296&&a<=56319){const i=a-55296;r++,ce(r>6|192,e[n++]=a&63|128):a<65536?(e[n++]=a>>12|224,e[n++]=a>>6&63|128,e[n++]=a&63|128):(e[n++]=a>>18|240,e[n++]=a>>12&63|128,e[n++]=a>>6&63|128,e[n++]=a&63|128)}return e},$0=function(t){let e=0;for(let n=0;n=55296&&r<=56319?(e+=4,n++):e+=3}return e};/** * @license * Copyright 2021 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function pn(t){return t&&t._delegate?t._delegate:t}class ds{constructor(e,n,r){this.name=e,this.instanceFactory=n,this.type=r,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY",this.onInstanceCreated=null}setInstantiationMode(e){return this.instantiationMode=e,this}setMultipleInstances(e){return this.multipleInstances=e,this}setServiceProps(e){return this.serviceProps=e,this}setInstanceCreatedCallback(e){return this.onInstanceCreated=e,this}}/** * @license * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const zs="[DEFAULT]";/** * @license * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class GF{constructor(e,n){this.name=e,this.container=n,this.component=null,this.instances=new Map,this.instancesDeferred=new Map,this.instancesOptions=new Map,this.onInitCallbacks=new Map}get(e){const n=this.normalizeInstanceIdentifier(e);if(!this.instancesDeferred.has(n)){const r=new W0;if(this.instancesDeferred.set(n,r),this.isInitialized(n)||this.shouldAutoInitialize())try{const a=this.getOrInitializeService({instanceIdentifier:n});a&&r.resolve(a)}catch{}}return this.instancesDeferred.get(n).promise}getImmediate(e){var n;const r=this.normalizeInstanceIdentifier(e==null?void 0:e.identifier),a=(n=e==null?void 0:e.optional)!==null&&n!==void 0?n:!1;if(this.isInitialized(r)||this.shouldAutoInitialize())try{return this.getOrInitializeService({instanceIdentifier:r})}catch(i){if(a)return null;throw i}else{if(a)return null;throw Error(`Service ${this.name} is not available`)}}getComponent(){return this.component}setComponent(e){if(e.name!==this.name)throw Error(`Mismatching Component ${e.name} for Provider ${this.name}.`);if(this.component)throw Error(`Component for ${this.name} has already been provided`);if(this.component=e,!!this.shouldAutoInitialize()){if(WF(e))try{this.getOrInitializeService({instanceIdentifier:zs})}catch{}for(const[n,r]of this.instancesDeferred.entries()){const a=this.normalizeInstanceIdentifier(n);try{const i=this.getOrInitializeService({instanceIdentifier:a});r.resolve(i)}catch{}}}}clearInstance(e=zs){this.instancesDeferred.delete(e),this.instancesOptions.delete(e),this.instances.delete(e)}async delete(){const e=Array.from(this.instances.values());await Promise.all([...e.filter(n=>"INTERNAL"in n).map(n=>n.INTERNAL.delete()),...e.filter(n=>"_delete"in n).map(n=>n._delete())])}isComponentSet(){return this.component!=null}isInitialized(e=zs){return this.instances.has(e)}getOptions(e=zs){return this.instancesOptions.get(e)||{}}initialize(e={}){const{options:n={}}=e,r=this.normalizeInstanceIdentifier(e.instanceIdentifier);if(this.isInitialized(r))throw Error(`${this.name}(${r}) has already been initialized`);if(!this.isComponentSet())throw Error(`Component ${this.name} has not been registered yet`);const a=this.getOrInitializeService({instanceIdentifier:r,options:n});for(const[i,s]of this.instancesDeferred.entries()){const o=this.normalizeInstanceIdentifier(i);r===o&&s.resolve(a)}return a}onInit(e,n){var r;const a=this.normalizeInstanceIdentifier(n),i=(r=this.onInitCallbacks.get(a))!==null&&r!==void 0?r:new Set;i.add(e),this.onInitCallbacks.set(a,i);const s=this.instances.get(a);return s&&e(s,a),()=>{i.delete(e)}}invokeOnInitCallbacks(e,n){const r=this.onInitCallbacks.get(n);if(r)for(const a of r)try{a(e,n)}catch{}}getOrInitializeService({instanceIdentifier:e,options:n={}}){let r=this.instances.get(e);if(!r&&this.component&&(r=this.component.instanceFactory(this.container,{instanceIdentifier:HF(e),options:n}),this.instances.set(e,r),this.instancesOptions.set(e,n),this.invokeOnInitCallbacks(r,e),this.component.onInstanceCreated))try{this.component.onInstanceCreated(this.container,e,r)}catch{}return r||null}normalizeInstanceIdentifier(e=zs){return this.component?this.component.multipleInstances?e:zs:e}shouldAutoInitialize(){return!!this.component&&this.component.instantiationMode!=="EXPLICIT"}}function HF(t){return t===zs?void 0:t}function WF(t){return t.instantiationMode==="EAGER"}/** * @license * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class $F{constructor(e){this.name=e,this.providers=new Map}addComponent(e){const n=this.getProvider(e.name);if(n.isComponentSet())throw new Error(`Component ${e.name} has already been registered with ${this.name}`);n.setComponent(e)}addOrOverwriteComponent(e){this.getProvider(e.name).isComponentSet()&&this.providers.delete(e.name),this.addComponent(e)}getProvider(e){if(this.providers.has(e))return this.providers.get(e);const n=new GF(e,this);return this.providers.set(e,n),n}getProviders(){return Array.from(this.providers.values())}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */var Ke;(function(t){t[t.DEBUG=0]="DEBUG",t[t.VERBOSE=1]="VERBOSE",t[t.INFO=2]="INFO",t[t.WARN=3]="WARN",t[t.ERROR=4]="ERROR",t[t.SILENT=5]="SILENT"})(Ke||(Ke={}));const KF={debug:Ke.DEBUG,verbose:Ke.VERBOSE,info:Ke.INFO,warn:Ke.WARN,error:Ke.ERROR,silent:Ke.SILENT},JF=Ke.INFO,YF={[Ke.DEBUG]:"log",[Ke.VERBOSE]:"log",[Ke.INFO]:"info",[Ke.WARN]:"warn",[Ke.ERROR]:"error"},XF=(t,e,...n)=>{if(ee.some(n=>t instanceof n);let LS,DS;function ZF(){return LS||(LS=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function e6(){return DS||(DS=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const nP=new WeakMap,E1=new WeakMap,rP=new WeakMap,Pg=new WeakMap,ky=new WeakMap;function t6(t){const e=new Promise((n,r)=>{const a=()=>{t.removeEventListener("success",i),t.removeEventListener("error",s)},i=()=>{n(as(t.result)),a()},s=()=>{r(t.error),a()};t.addEventListener("success",i),t.addEventListener("error",s)});return e.then(n=>{n instanceof IDBCursor&&nP.set(n,t)}).catch(()=>{}),ky.set(e,t),e}function n6(t){if(E1.has(t))return;const e=new Promise((n,r)=>{const a=()=>{t.removeEventListener("complete",i),t.removeEventListener("error",s),t.removeEventListener("abort",s)},i=()=>{n(),a()},s=()=>{r(t.error||new DOMException("AbortError","AbortError")),a()};t.addEventListener("complete",i),t.addEventListener("error",s),t.addEventListener("abort",s)});E1.set(t,e)}let b1={get(t,e,n){if(t instanceof IDBTransaction){if(e==="done")return E1.get(t);if(e==="objectStoreNames")return t.objectStoreNames||rP.get(t);if(e==="store")return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return as(t[e])},set(t,e,n){return t[e]=n,!0},has(t,e){return t instanceof IDBTransaction&&(e==="done"||e==="store")?!0:e in t}};function r6(t){b1=t(b1)}function a6(t){return t===IDBDatabase.prototype.transaction&&!("objectStoreNames"in IDBTransaction.prototype)?function(e,...n){const r=t.call(Rg(this),e,...n);return rP.set(r,e.sort?e.sort():[e]),as(r)}:e6().includes(t)?function(...e){return t.apply(Rg(this),e),as(nP.get(this))}:function(...e){return as(t.apply(Rg(this),e))}}function i6(t){return typeof t=="function"?a6(t):(t instanceof IDBTransaction&&n6(t),QF(t,ZF())?new Proxy(t,b1):t)}function as(t){if(t instanceof IDBRequest)return t6(t);if(Pg.has(t))return Pg.get(t);const e=i6(t);return e!==t&&(Pg.set(t,e),ky.set(e,t)),e}const Rg=t=>ky.get(t);function s6(t,e,{blocked:n,upgrade:r,blocking:a,terminated:i}={}){const s=indexedDB.open(t,e),o=as(s);return r&&s.addEventListener("upgradeneeded",l=>{r(as(s.result),l.oldVersion,l.newVersion,as(s.transaction),l)}),n&&s.addEventListener("blocked",l=>n(l.oldVersion,l.newVersion,l)),o.then(l=>{i&&l.addEventListener("close",()=>i()),a&&l.addEventListener("versionchange",u=>a(u.oldVersion,u.newVersion,u))}).catch(()=>{}),o}const o6=["get","getKey","getAll","getAllKeys","count"],l6=["put","add","delete","clear"],kg=new Map;function FS(t,e){if(!(t instanceof IDBDatabase&&!(e in t)&&typeof e=="string"))return;if(kg.get(e))return kg.get(e);const n=e.replace(/FromIndex$/,""),r=e!==n,a=l6.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!(a||o6.includes(n)))return;const i=async function(s,...o){const l=this.transaction(s,a?"readwrite":"readonly");let u=l.store;return r&&(u=u.index(o.shift())),(await Promise.all([u[n](...o),a&&l.done]))[0]};return kg.set(e,i),i}r6(t=>({...t,get:(e,n,r)=>FS(e,n)||t.get(e,n,r),has:(e,n)=>!!FS(e,n)||t.has(e,n)}));/** * @license * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class u6{constructor(e){this.container=e}getPlatformInfoString(){return this.container.getProviders().map(n=>{if(c6(n)){const r=n.getImmediate();return`${r.library}/${r.version}`}else return null}).filter(n=>n).join(" ")}}function c6(t){const e=t.getComponent();return(e==null?void 0:e.type)==="VERSION"}const x1="@firebase/app",BS="0.10.9";/** * @license * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const li=new K0("@firebase/app"),d6="@firebase/app-compat",h6="@firebase/analytics-compat",f6="@firebase/analytics",p6="@firebase/app-check-compat",m6="@firebase/app-check",g6="@firebase/auth",v6="@firebase/auth-compat",_6="@firebase/database",y6="@firebase/database-compat",E6="@firebase/functions",b6="@firebase/functions-compat",x6="@firebase/installations",S6="@firebase/installations-compat",T6="@firebase/messaging",w6="@firebase/messaging-compat",C6="@firebase/performance",A6="@firebase/performance-compat",I6="@firebase/remote-config",P6="@firebase/remote-config-compat",R6="@firebase/storage",k6="@firebase/storage-compat",N6="@firebase/firestore",O6="@firebase/vertexai-preview",M6="@firebase/firestore-compat",L6="firebase",D6="10.13.0";/** * @license * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const S1="[DEFAULT]",F6={[x1]:"fire-core",[d6]:"fire-core-compat",[f6]:"fire-analytics",[h6]:"fire-analytics-compat",[m6]:"fire-app-check",[p6]:"fire-app-check-compat",[g6]:"fire-auth",[v6]:"fire-auth-compat",[_6]:"fire-rtdb",[y6]:"fire-rtdb-compat",[E6]:"fire-fn",[b6]:"fire-fn-compat",[x6]:"fire-iid",[S6]:"fire-iid-compat",[T6]:"fire-fcm",[w6]:"fire-fcm-compat",[C6]:"fire-perf",[A6]:"fire-perf-compat",[I6]:"fire-rc",[P6]:"fire-rc-compat",[R6]:"fire-gcs",[k6]:"fire-gcs-compat",[N6]:"fire-fst",[M6]:"fire-fst-compat",[O6]:"fire-vertex","fire-js":"fire-js",[L6]:"fire-js-all"};/** * @license * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const Np=new Map,B6=new Map,T1=new Map;function US(t,e){try{t.container.addComponent(e)}catch(n){li.debug(`Component ${e.name} failed to register with FirebaseApp ${t.name}`,n)}}function vo(t){const e=t.name;if(T1.has(e))return li.debug(`There were multiple attempts to register component ${e}.`),!1;T1.set(e,t);for(const n of Np.values())US(n,t);for(const n of B6.values())US(n,t);return!0}function J0(t,e){const n=t.container.getProvider("heartbeat").getImmediate({optional:!0});return n&&n.triggerHeartbeat(),t.container.getProvider(e)}function $a(t){return t.settings!==void 0}/** * @license * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const U6={"no-app":"No Firebase App '{$appName}' has been created - call initializeApp() first","bad-app-name":"Illegal App name: '{$appName}'","duplicate-app":"Firebase App named '{$appName}' already exists with different options or config","app-deleted":"Firebase App named '{$appName}' already deleted","server-app-deleted":"Firebase Server App has been deleted","no-options":"Need to provide options, when not being deployed to hosting via source.","invalid-app-argument":"firebase.{$appName}() takes either no argument or a Firebase App instance.","invalid-log-argument":"First argument to `onLog` must be null or a function.","idb-open":"Error thrown when opening IndexedDB. Original error: {$originalErrorMessage}.","idb-get":"Error thrown when reading from IndexedDB. Original error: {$originalErrorMessage}.","idb-set":"Error thrown when writing to IndexedDB. Original error: {$originalErrorMessage}.","idb-delete":"Error thrown when deleting from IndexedDB. Original error: {$originalErrorMessage}.","finalization-registry-not-supported":"FirebaseServerApp deleteOnDeref field defined but the JS runtime does not support FinalizationRegistry.","invalid-server-app-environment":"FirebaseServerApp is not for use in browser environments."},is=new eh("app","Firebase",U6);/** * @license * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class V6{constructor(e,n,r){this._isDeleted=!1,this._options=Object.assign({},e),this._config=Object.assign({},n),this._name=n.name,this._automaticDataCollectionEnabled=n.automaticDataCollectionEnabled,this._container=r,this.container.addComponent(new ds("app",()=>this,"PUBLIC"))}get automaticDataCollectionEnabled(){return this.checkDestroyed(),this._automaticDataCollectionEnabled}set automaticDataCollectionEnabled(e){this.checkDestroyed(),this._automaticDataCollectionEnabled=e}get name(){return this.checkDestroyed(),this._name}get options(){return this.checkDestroyed(),this._options}get config(){return this.checkDestroyed(),this._config}get container(){return this._container}get isDeleted(){return this._isDeleted}set isDeleted(e){this._isDeleted=e}checkDestroyed(){if(this.isDeleted)throw is.create("app-deleted",{appName:this._name})}}/** * @license * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const Lo=D6;function Ny(t,e={}){let n=t;typeof e!="object"&&(e={name:e});const r=Object.assign({name:S1,automaticDataCollectionEnabled:!1},e),a=r.name;if(typeof a!="string"||!a)throw is.create("bad-app-name",{appName:String(a)});if(n||(n=YI()),!n)throw is.create("no-options");const i=Np.get(a);if(i){if(kp(n,i.options)&&kp(r,i.config))return i;throw is.create("duplicate-app",{appName:a})}const s=new $F(a);for(const l of T1.values())s.addComponent(l);const o=new V6(n,r,s);return Np.set(a,o),o}function Oy(t=S1){const e=Np.get(t);if(!e&&t===S1&&YI())return Ny();if(!e)throw is.create("no-app",{appName:t});return e}function Ca(t,e,n){var r;let a=(r=F6[t])!==null&&r!==void 0?r:t;n&&(a+=`-${n}`);const i=a.match(/\s|\//),s=e.match(/\s|\//);if(i||s){const o=[`Unable to register library "${a}" with version "${e}":`];i&&o.push(`library name "${a}" contains illegal characters (whitespace or "/")`),i&&s&&o.push("and"),s&&o.push(`version name "${e}" contains illegal characters (whitespace or "/")`),li.warn(o.join(" "));return}vo(new ds(`${a}-version`,()=>({library:a,version:e}),"VERSION"))}/** * @license * Copyright 2021 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const j6="firebase-heartbeat-database",z6=1,md="firebase-heartbeat-store";let Ng=null;function aP(){return Ng||(Ng=s6(j6,z6,{upgrade:(t,e)=>{switch(e){case 0:try{t.createObjectStore(md)}catch(n){console.warn(n)}}}}).catch(t=>{throw is.create("idb-open",{originalErrorMessage:t.message})})),Ng}async function q6(t){try{const n=(await aP()).transaction(md),r=await n.objectStore(md).get(iP(t));return await n.done,r}catch(e){if(e instanceof vi)li.warn(e.message);else{const n=is.create("idb-get",{originalErrorMessage:e==null?void 0:e.message});li.warn(n.message)}}}async function VS(t,e){try{const r=(await aP()).transaction(md,"readwrite");await r.objectStore(md).put(e,iP(t)),await r.done}catch(n){if(n instanceof vi)li.warn(n.message);else{const r=is.create("idb-set",{originalErrorMessage:n==null?void 0:n.message});li.warn(r.message)}}}function iP(t){return`${t.name}!${t.options.appId}`}/** * @license * Copyright 2021 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const G6=1024,H6=30*24*60*60*1e3;class W6{constructor(e){this.container=e,this._heartbeatsCache=null;const n=this.container.getProvider("app").getImmediate();this._storage=new K6(n),this._heartbeatsCachePromise=this._storage.read().then(r=>(this._heartbeatsCache=r,r))}async triggerHeartbeat(){var e,n,r;try{const i=this.container.getProvider("platform-logger").getImmediate().getPlatformInfoString(),s=jS();return console.log("heartbeats",(e=this._heartbeatsCache)===null||e===void 0?void 0:e.heartbeats),((n=this._heartbeatsCache)===null||n===void 0?void 0:n.heartbeats)==null&&(this._heartbeatsCache=await this._heartbeatsCachePromise,((r=this._heartbeatsCache)===null||r===void 0?void 0:r.heartbeats)==null)||this._heartbeatsCache.lastSentHeartbeatDate===s||this._heartbeatsCache.heartbeats.some(o=>o.date===s)?void 0:(this._heartbeatsCache.heartbeats.push({date:s,agent:i}),this._heartbeatsCache.heartbeats=this._heartbeatsCache.heartbeats.filter(o=>{const l=new Date(o.date).valueOf();return Date.now()-l<=H6}),this._storage.overwrite(this._heartbeatsCache))}catch(a){li.warn(a)}}async getHeartbeatsHeader(){var e;try{if(this._heartbeatsCache===null&&await this._heartbeatsCachePromise,((e=this._heartbeatsCache)===null||e===void 0?void 0:e.heartbeats)==null||this._heartbeatsCache.heartbeats.length===0)return"";const n=jS(),{heartbeatsToSend:r,unsentEntries:a}=$6(this._heartbeatsCache.heartbeats),i=Ip(JSON.stringify({version:2,heartbeats:r}));return this._heartbeatsCache.lastSentHeartbeatDate=n,a.length>0?(this._heartbeatsCache.heartbeats=a,await this._storage.overwrite(this._heartbeatsCache)):(this._heartbeatsCache.heartbeats=[],this._storage.overwrite(this._heartbeatsCache)),i}catch(n){return li.warn(n),""}}}function jS(){return new Date().toISOString().substring(0,10)}function $6(t,e=G6){const n=[];let r=t.slice();for(const a of t){const i=n.find(s=>s.agent===a.agent);if(i){if(i.dates.push(a.date),zS(n)>e){i.dates.pop();break}}else if(n.push({agent:a.agent,dates:[a.date]}),zS(n)>e){n.pop();break}r=r.slice(1)}return{heartbeatsToSend:n,unsentEntries:r}}class K6{constructor(e){this.app=e,this._canUseIndexedDBPromise=this.runIndexedDBEnvironmentCheck()}async runIndexedDBEnvironmentCheck(){return NF()?OF().then(()=>!0).catch(()=>!1):!1}async read(){if(await this._canUseIndexedDBPromise){const n=await q6(this.app);return n!=null&&n.heartbeats?n:{heartbeats:[]}}else return{heartbeats:[]}}async overwrite(e){var n;if(await this._canUseIndexedDBPromise){const a=await this.read();return VS(this.app,{lastSentHeartbeatDate:(n=e.lastSentHeartbeatDate)!==null&&n!==void 0?n:a.lastSentHeartbeatDate,heartbeats:e.heartbeats})}else return}async add(e){var n;if(await this._canUseIndexedDBPromise){const a=await this.read();return VS(this.app,{lastSentHeartbeatDate:(n=e.lastSentHeartbeatDate)!==null&&n!==void 0?n:a.lastSentHeartbeatDate,heartbeats:[...a.heartbeats,...e.heartbeats]})}else return}}function zS(t){return Ip(JSON.stringify({version:2,heartbeats:t})).length}/** * @license * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function J6(t){vo(new ds("platform-logger",e=>new u6(e),"PRIVATE")),vo(new ds("heartbeat",e=>new W6(e),"PRIVATE")),Ca(x1,BS,t),Ca(x1,BS,"esm2017"),Ca("fire-js","")}J6("");var Y6="firebase",X6="10.13.0";/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */Ca(Y6,X6,"app");var qS={};const GS="@firebase/database",HS="1.0.7";/** * @license * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */let sP="";function Q6(t){sP=t}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class Z6{constructor(e){this.domStorage_=e,this.prefix_="firebase:"}set(e,n){n==null?this.domStorage_.removeItem(this.prefixedName_(e)):this.domStorage_.setItem(this.prefixedName_(e),tn(n))}get(e){const n=this.domStorage_.getItem(this.prefixedName_(e));return n==null?null:pd(n)}remove(e){this.domStorage_.removeItem(this.prefixedName_(e))}prefixedName_(e){return this.prefix_+e}toString(){return this.domStorage_.toString()}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class e5{constructor(){this.cache_={},this.isInMemoryStorage=!0}set(e,n){n==null?delete this.cache_[e]:this.cache_[e]=n}get(e){return La(this.cache_,e)?this.cache_[e]:null}remove(e){delete this.cache_[e]}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const oP=function(t){try{if(typeof window<"u"&&typeof window[t]<"u"){const e=window[t];return e.setItem("firebase:sentinel","cache"),e.removeItem("firebase:sentinel"),new Z6(e)}}catch{}return new e5},Ys=oP("localStorage"),t5=oP("sessionStorage");/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const Rl=new K0("@firebase/database"),n5=function(){let t=1;return function(){return t++}}(),lP=function(t){const e=qF(t),n=new UF;n.update(e);const r=n.digest();return Iy.encodeByteArray(r)},th=function(...t){let e="";for(let n=0;n{document.readyState==="complete"&&n()}),window.attachEvent("onload",n))}},_o="[MIN_NAME]",hs="[MAX_NAME]",gu=function(t,e){if(t===e)return 0;if(t===_o||e===hs)return-1;if(e===_o||t===hs)return 1;{const n=$S(t),r=$S(e);return n!==null?r!==null?n-r===0?t.length-e.length:n-r:-1:r!==null?1:tn?r.push(t.substring(a,n)):r.push(t.substring(a,a+e));return r};function cr(t,e){for(const n in t)t.hasOwnProperty(n)&&e(n,t[n])}const cP=function(t){ce(!My(t),"Invalid JSON number");const e=11,n=52,r=(1<=Math.pow(2,1-r)?(o=Math.min(Math.floor(Math.log(t)/Math.LN2),r),i=o+r,s=Math.round(t*Math.pow(2,n-o)-Math.pow(2,n))):(i=0,s=Math.round(t/Math.pow(2,1-r-n))));const u=[];for(l=n;l;l-=1)u.push(s%2?1:0),s=Math.floor(s/2);for(l=e;l;l-=1)u.push(i%2?1:0),i=Math.floor(i/2);u.push(a?1:0),u.reverse();const c=u.join("");let h="";for(l=0;l<64;l+=8){let f=parseInt(c.substr(l,8),2).toString(16);f.length===1&&(f="0"+f),h=h+f}return h.toLowerCase()},o5=function(){return!!(typeof window=="object"&&window.chrome&&window.chrome.extension&&!/^chrome/.test(window.location.href))},l5=function(){return typeof Windows=="object"&&typeof Windows.UI=="object"};function u5(t,e){let n="Unknown Error";t==="too_big"?n="The data requested exceeds the maximum size that can be accessed with a single request.":t==="permission_denied"?n="Client doesn't have permission to access the desired data.":t==="unavailable"&&(n="The service is unavailable");const r=new Error(t+" at "+e._path.toString()+": "+n);return r.code=t.toUpperCase(),r}const c5=new RegExp("^-?(0*)\\d{1,10}$"),d5=-2147483648,h5=2147483647,$S=function(t){if(c5.test(t)){const e=Number(t);if(e>=d5&&e<=h5)return e}return null},vu=function(t){try{t()}catch(e){setTimeout(()=>{const n=e.stack||"";throw sr("Exception was thrown by user callback.",n),e},Math.floor(0))}},f5=function(){return(typeof window=="object"&&window.navigator&&window.navigator.userAgent||"").search(/googlebot|google webmaster tools|bingbot|yahoo! slurp|baiduspider|yandexbot|duckduckbot/i)>=0},kc=function(t,e){const n=setTimeout(t,e);return typeof n=="number"&&typeof Deno<"u"&&Deno.unrefTimer?Deno.unrefTimer(n):typeof n=="object"&&n.unref&&n.unref(),n};/** * @license * Copyright 2021 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class p5{constructor(e,n){this.appName_=e,this.appCheckProvider=n,this.appCheck=n==null?void 0:n.getImmediate({optional:!0}),this.appCheck||n==null||n.get().then(r=>this.appCheck=r)}getToken(e){return this.appCheck?this.appCheck.getToken(e):new Promise((n,r)=>{setTimeout(()=>{this.appCheck?this.getToken(e).then(n,r):n(null)},0)})}addTokenChangeListener(e){var n;(n=this.appCheckProvider)===null||n===void 0||n.get().then(r=>r.addTokenListener(e))}notifyForInvalidToken(){sr(`Provided AppCheck credentials for the app named "${this.appName_}" are invalid. This usually indicates your app was not initialized correctly.`)}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class m5{constructor(e,n,r){this.appName_=e,this.firebaseOptions_=n,this.authProvider_=r,this.auth_=null,this.auth_=r.getImmediate({optional:!0}),this.auth_||r.onInit(a=>this.auth_=a)}getToken(e){return this.auth_?this.auth_.getToken(e).catch(n=>n&&n.code==="auth/token-not-initialized"?(Fn("Got auth/token-not-initialized error. Treating as null token."),null):Promise.reject(n)):new Promise((n,r)=>{setTimeout(()=>{this.auth_?this.getToken(e).then(n,r):n(null)},0)})}addTokenChangeListener(e){this.auth_?this.auth_.addAuthTokenListener(e):this.authProvider_.get().then(n=>n.addAuthTokenListener(e))}removeTokenChangeListener(e){this.authProvider_.get().then(n=>n.removeAuthTokenListener(e))}notifyForInvalidToken(){let e='Provided authentication credentials for the app named "'+this.appName_+'" are invalid. This usually indicates your app was not initialized correctly. ';"credential"in this.firebaseOptions_?e+='Make sure the "credential" property provided to initializeApp() is authorized to access the specified "databaseURL" and is from the correct project.':"serviceAccount"in this.firebaseOptions_?e+='Make sure the "serviceAccount" property provided to initializeApp() is authorized to access the specified "databaseURL" and is from the correct project.':e+='Make sure the "apiKey" and "databaseURL" properties provided to initializeApp() match the values provided for your app at https://console.firebase.google.com/.',sr(e)}}class Vf{constructor(e){this.accessToken=e}getToken(e){return Promise.resolve({accessToken:this.accessToken})}addTokenChangeListener(e){e(this.accessToken)}removeTokenChangeListener(e){}notifyForInvalidToken(){}}Vf.OWNER="owner";/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const Dy="5",dP="v",hP="s",fP="r",pP="f",mP=/(console\.firebase|firebase-console-\w+\.corp|firebase\.corp)\.google\.com/,gP="ls",vP="p",C1="ac",_P="websocket",yP="long_polling";/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class EP{constructor(e,n,r,a,i=!1,s="",o=!1,l=!1){this.secure=n,this.namespace=r,this.webSocketOnly=a,this.nodeAdmin=i,this.persistenceKey=s,this.includeNamespaceInQueryParams=o,this.isUsingEmulator=l,this._host=e.toLowerCase(),this._domain=this._host.substr(this._host.indexOf(".")+1),this.internalHost=Ys.get("host:"+e)||this._host}isCacheableHost(){return this.internalHost.substr(0,2)==="s-"}isCustomHost(){return this._domain!=="firebaseio.com"&&this._domain!=="firebaseio-demo.com"}get host(){return this._host}set host(e){e!==this.internalHost&&(this.internalHost=e,this.isCacheableHost()&&Ys.set("host:"+this._host,this.internalHost))}toString(){let e=this.toURLString();return this.persistenceKey&&(e+="<"+this.persistenceKey+">"),e}toURLString(){const e=this.secure?"https://":"http://",n=this.includeNamespaceInQueryParams?`?ns=${this.namespace}`:"";return`${e}${this.host}/${n}`}}function g5(t){return t.host!==t.internalHost||t.isCustomHost()||t.includeNamespaceInQueryParams}function bP(t,e,n){ce(typeof e=="string","typeof type must == string"),ce(typeof n=="object","typeof params must == object");let r;if(e===_P)r=(t.secure?"wss://":"ws://")+t.internalHost+"/.ws?";else if(e===yP)r=(t.secure?"https://":"http://")+t.internalHost+"/.lp?";else throw new Error("Unknown connection type: "+e);g5(t)&&(n.ns=t.namespace);const a=[];return cr(n,(i,s)=>{a.push(i+"="+s)}),r+a.join("&")}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class v5{constructor(){this.counters_={}}incrementCounter(e,n=1){La(this.counters_,e)||(this.counters_[e]=0),this.counters_[e]+=n}get(){return xF(this.counters_)}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const Og={},Mg={};function Fy(t){const e=t.toString();return Og[e]||(Og[e]=new v5),Og[e]}function _5(t,e){const n=t.toString();return Mg[n]||(Mg[n]=e()),Mg[n]}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class y5{constructor(e){this.onMessage_=e,this.pendingResponses=[],this.currentResponseNum=0,this.closeAfterResponse=-1,this.onClose=null}closeAfter(e,n){this.closeAfterResponse=e,this.onClose=n,this.closeAfterResponse{this.onMessage_(r[a])});if(this.currentResponseNum===this.closeAfterResponse){this.onClose&&(this.onClose(),this.onClose=null);break}this.currentResponseNum++}}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const KS="start",E5="close",b5="pLPCommand",x5="pRTLPCB",xP="id",SP="pw",TP="ser",S5="cb",T5="seg",w5="ts",C5="d",A5="dframe",wP=1870,CP=30,I5=wP-CP,P5=25e3,R5=3e4;class _l{constructor(e,n,r,a,i,s,o){this.connId=e,this.repoInfo=n,this.applicationId=r,this.appCheckToken=a,this.authToken=i,this.transportSessionId=s,this.lastSessionId=o,this.bytesSent=0,this.bytesReceived=0,this.everConnected_=!1,this.log_=nh(e),this.stats_=Fy(n),this.urlFn=l=>(this.appCheckToken&&(l[C1]=this.appCheckToken),bP(n,yP,l))}open(e,n){this.curSegmentNum=0,this.onDisconnect_=n,this.myPacketOrderer=new y5(e),this.isClosed_=!1,this.connectTimeoutTimer_=setTimeout(()=>{this.log_("Timed out trying to connect."),this.onClosed_(),this.connectTimeoutTimer_=null},Math.floor(R5)),i5(()=>{if(this.isClosed_)return;this.scriptTagHolder=new By((...i)=>{const[s,o,l,u,c]=i;if(this.incrementIncomingBytes_(i),!!this.scriptTagHolder)if(this.connectTimeoutTimer_&&(clearTimeout(this.connectTimeoutTimer_),this.connectTimeoutTimer_=null),this.everConnected_=!0,s===KS)this.id=o,this.password=l;else if(s===E5)o?(this.scriptTagHolder.sendNewPolls=!1,this.myPacketOrderer.closeAfter(o,()=>{this.onClosed_()})):this.onClosed_();else throw new Error("Unrecognized command received: "+s)},(...i)=>{const[s,o]=i;this.incrementIncomingBytes_(i),this.myPacketOrderer.handleResponse(s,o)},()=>{this.onClosed_()},this.urlFn);const r={};r[KS]="t",r[TP]=Math.floor(Math.random()*1e8),this.scriptTagHolder.uniqueCallbackIdentifier&&(r[S5]=this.scriptTagHolder.uniqueCallbackIdentifier),r[dP]=Dy,this.transportSessionId&&(r[hP]=this.transportSessionId),this.lastSessionId&&(r[gP]=this.lastSessionId),this.applicationId&&(r[vP]=this.applicationId),this.appCheckToken&&(r[C1]=this.appCheckToken),typeof location<"u"&&location.hostname&&mP.test(location.hostname)&&(r[fP]=pP);const a=this.urlFn(r);this.log_("Connecting via long-poll to "+a),this.scriptTagHolder.addTag(a,()=>{})})}start(){this.scriptTagHolder.startLongPoll(this.id,this.password),this.addDisconnectPingFrame(this.id,this.password)}static forceAllow(){_l.forceAllow_=!0}static forceDisallow(){_l.forceDisallow_=!0}static isAvailable(){return _l.forceAllow_?!0:!_l.forceDisallow_&&typeof document<"u"&&document.createElement!=null&&!o5()&&!l5()}markConnectionHealthy(){}shutdown_(){this.isClosed_=!0,this.scriptTagHolder&&(this.scriptTagHolder.close(),this.scriptTagHolder=null),this.myDisconnFrame&&(document.body.removeChild(this.myDisconnFrame),this.myDisconnFrame=null),this.connectTimeoutTimer_&&(clearTimeout(this.connectTimeoutTimer_),this.connectTimeoutTimer_=null)}onClosed_(){this.isClosed_||(this.log_("Longpoll is closing itself"),this.shutdown_(),this.onDisconnect_&&(this.onDisconnect_(this.everConnected_),this.onDisconnect_=null))}close(){this.isClosed_||(this.log_("Longpoll is being closed."),this.shutdown_())}send(e){const n=tn(e);this.bytesSent+=n.length,this.stats_.incrementCounter("bytes_sent",n.length);const r=WI(n),a=uP(r,I5);for(let i=0;idocument.domain="'+document.domain+'";<\/script>');const s=""+i+"";try{this.myIFrame.doc.open(),this.myIFrame.doc.write(s),this.myIFrame.doc.close()}catch(o){Fn("frame writing exception"),o.stack&&Fn(o.stack),Fn(o)}}}static createIFrame_(){const e=document.createElement("iframe");if(e.style.display="none",document.body){document.body.appendChild(e);try{e.contentWindow.document||Fn("No IE domain setting required")}catch{const r=document.domain;e.src="javascript:void((function(){document.open();document.domain='"+r+"';document.close();})())"}}else throw"Document body has not initialized. Wait to initialize Firebase until after the document is ready.";return e.contentDocument?e.doc=e.contentDocument:e.contentWindow?e.doc=e.contentWindow.document:e.document&&(e.doc=e.document),e}close(){this.alive=!1,this.myIFrame&&(this.myIFrame.doc.body.textContent="",setTimeout(()=>{this.myIFrame!==null&&(document.body.removeChild(this.myIFrame),this.myIFrame=null)},Math.floor(0)));const e=this.onDisconnect;e&&(this.onDisconnect=null,e())}startLongPoll(e,n){for(this.myID=e,this.myPW=n,this.alive=!0;this.newRequest_(););}newRequest_(){if(this.alive&&this.sendNewPolls&&this.outstandingRequests.size<(this.pendingSegs.length>0?2:1)){this.currentSerial++;const e={};e[xP]=this.myID,e[SP]=this.myPW,e[TP]=this.currentSerial;let n=this.urlFn(e),r="",a=0;for(;this.pendingSegs.length>0&&this.pendingSegs[0].d.length+CP+r.length<=wP;){const s=this.pendingSegs.shift();r=r+"&"+T5+a+"="+s.seg+"&"+w5+a+"="+s.ts+"&"+C5+a+"="+s.d,a++}return n=n+r,this.addLongPollTag_(n,this.currentSerial),!0}else return!1}enqueueSegment(e,n,r){this.pendingSegs.push({seg:e,ts:n,d:r}),this.alive&&this.newRequest_()}addLongPollTag_(e,n){this.outstandingRequests.add(n);const r=()=>{this.outstandingRequests.delete(n),this.newRequest_()},a=setTimeout(r,Math.floor(P5)),i=()=>{clearTimeout(a),r()};this.addTag(e,i)}addTag(e,n){setTimeout(()=>{try{if(!this.sendNewPolls)return;const r=this.myIFrame.doc.createElement("script");r.type="text/javascript",r.async=!0,r.src=e,r.onload=r.onreadystatechange=function(){const a=r.readyState;(!a||a==="loaded"||a==="complete")&&(r.onload=r.onreadystatechange=null,r.parentNode&&r.parentNode.removeChild(r),n())},r.onerror=()=>{Fn("Long-poll script failed to load: "+e),this.sendNewPolls=!1,this.close()},this.myIFrame.doc.body.appendChild(r)}catch{}},Math.floor(1))}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const k5=16384,N5=45e3;let Op=null;typeof MozWebSocket<"u"?Op=MozWebSocket:typeof WebSocket<"u"&&(Op=WebSocket);class Zr{constructor(e,n,r,a,i,s,o){this.connId=e,this.applicationId=r,this.appCheckToken=a,this.authToken=i,this.keepaliveTimer=null,this.frames=null,this.totalFrames=0,this.bytesSent=0,this.bytesReceived=0,this.log_=nh(this.connId),this.stats_=Fy(n),this.connURL=Zr.connectionURL_(n,s,o,a,r),this.nodeAdmin=n.nodeAdmin}static connectionURL_(e,n,r,a,i){const s={};return s[dP]=Dy,typeof location<"u"&&location.hostname&&mP.test(location.hostname)&&(s[fP]=pP),n&&(s[hP]=n),r&&(s[gP]=r),a&&(s[C1]=a),i&&(s[vP]=i),bP(e,_P,s)}open(e,n){this.onDisconnect=n,this.onMessage=e,this.log_("Websocket connecting to "+this.connURL),this.everConnected_=!1,Ys.set("previous_websocket_failure",!0);try{let r;eP(),this.mySock=new Op(this.connURL,[],r)}catch(r){this.log_("Error instantiating WebSocket.");const a=r.message||r.data;a&&this.log_(a),this.onClosed_();return}this.mySock.onopen=()=>{this.log_("Websocket connected."),this.everConnected_=!0},this.mySock.onclose=()=>{this.log_("Websocket connection was disconnected."),this.mySock=null,this.onClosed_()},this.mySock.onmessage=r=>{this.handleIncomingFrame(r)},this.mySock.onerror=r=>{this.log_("WebSocket error. Closing connection.");const a=r.message||r.data;a&&this.log_(a),this.onClosed_()}}start(){}static forceDisallow(){Zr.forceDisallow_=!0}static isAvailable(){let e=!1;if(typeof navigator<"u"&&navigator.userAgent){const n=/Android ([0-9]{0,}\.[0-9]{0,})/,r=navigator.userAgent.match(n);r&&r.length>1&&parseFloat(r[1])<4.4&&(e=!0)}return!e&&Op!==null&&!Zr.forceDisallow_}static previouslyFailed(){return Ys.isInMemoryStorage||Ys.get("previous_websocket_failure")===!0}markConnectionHealthy(){Ys.remove("previous_websocket_failure")}appendFrame_(e){if(this.frames.push(e),this.frames.length===this.totalFrames){const n=this.frames.join("");this.frames=null;const r=pd(n);this.onMessage(r)}}handleNewFrameCount_(e){this.totalFrames=e,this.frames=[]}extractFrameCount_(e){if(ce(this.frames===null,"We already have a frame buffer"),e.length<=6){const n=Number(e);if(!isNaN(n))return this.handleNewFrameCount_(n),null}return this.handleNewFrameCount_(1),e}handleIncomingFrame(e){if(this.mySock===null)return;const n=e.data;if(this.bytesReceived+=n.length,this.stats_.incrementCounter("bytes_received",n.length),this.resetKeepAlive(),this.frames!==null)this.appendFrame_(n);else{const r=this.extractFrameCount_(n);r!==null&&this.appendFrame_(r)}}send(e){this.resetKeepAlive();const n=tn(e);this.bytesSent+=n.length,this.stats_.incrementCounter("bytes_sent",n.length);const r=uP(n,k5);r.length>1&&this.sendString_(String(r.length));for(let a=0;a{this.mySock&&this.sendString_("0"),this.resetKeepAlive()},Math.floor(N5))}sendString_(e){try{this.mySock.send(e)}catch(n){this.log_("Exception thrown from WebSocket.send():",n.message||n.data,"Closing connection."),setTimeout(this.onClosed_.bind(this),0)}}}Zr.responsesRequiredToBeHealthy=2;Zr.healthyTimeout=3e4;/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class gd{constructor(e){this.initTransports_(e)}static get ALL_TRANSPORTS(){return[_l,Zr]}static get IS_TRANSPORT_INITIALIZED(){return this.globalTransportInitialized_}initTransports_(e){const n=Zr&&Zr.isAvailable();let r=n&&!Zr.previouslyFailed();if(e.webSocketOnly&&(n||sr("wss:// URL used, but browser isn't known to support websockets. Trying anyway."),r=!0),r)this.transports_=[Zr];else{const a=this.transports_=[];for(const i of gd.ALL_TRANSPORTS)i&&i.isAvailable()&&a.push(i);gd.globalTransportInitialized_=!0}}initialTransport(){if(this.transports_.length>0)return this.transports_[0];throw new Error("No transports available")}upgradeTransport(){return this.transports_.length>1?this.transports_[1]:null}}gd.globalTransportInitialized_=!1;/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const O5=6e4,M5=5e3,L5=10*1024,D5=100*1024,Lg="t",JS="d",F5="s",YS="r",B5="e",XS="o",QS="a",ZS="n",eT="p",U5="h";class V5{constructor(e,n,r,a,i,s,o,l,u,c){this.id=e,this.repoInfo_=n,this.applicationId_=r,this.appCheckToken_=a,this.authToken_=i,this.onMessage_=s,this.onReady_=o,this.onDisconnect_=l,this.onKill_=u,this.lastSessionId=c,this.connectionCount=0,this.pendingDataMessages=[],this.state_=0,this.log_=nh("c:"+this.id+":"),this.transportManager_=new gd(n),this.log_("Connection created"),this.start_()}start_(){const e=this.transportManager_.initialTransport();this.conn_=new e(this.nextTransportId_(),this.repoInfo_,this.applicationId_,this.appCheckToken_,this.authToken_,null,this.lastSessionId),this.primaryResponsesRequired_=e.responsesRequiredToBeHealthy||0;const n=this.connReceiver_(this.conn_),r=this.disconnReceiver_(this.conn_);this.tx_=this.conn_,this.rx_=this.conn_,this.secondaryConn_=null,this.isHealthy_=!1,setTimeout(()=>{this.conn_&&this.conn_.open(n,r)},Math.floor(0));const a=e.healthyTimeout||0;a>0&&(this.healthyTimeout_=kc(()=>{this.healthyTimeout_=null,this.isHealthy_||(this.conn_&&this.conn_.bytesReceived>D5?(this.log_("Connection exceeded healthy timeout but has received "+this.conn_.bytesReceived+" bytes. Marking connection healthy."),this.isHealthy_=!0,this.conn_.markConnectionHealthy()):this.conn_&&this.conn_.bytesSent>L5?this.log_("Connection exceeded healthy timeout but has sent "+this.conn_.bytesSent+" bytes. Leaving connection alive."):(this.log_("Closing unhealthy connection after timeout."),this.close()))},Math.floor(a)))}nextTransportId_(){return"c:"+this.id+":"+this.connectionCount++}disconnReceiver_(e){return n=>{e===this.conn_?this.onConnectionLost_(n):e===this.secondaryConn_?(this.log_("Secondary connection lost."),this.onSecondaryConnectionLost_()):this.log_("closing an old connection")}}connReceiver_(e){return n=>{this.state_!==2&&(e===this.rx_?this.onPrimaryMessageReceived_(n):e===this.secondaryConn_?this.onSecondaryMessageReceived_(n):this.log_("message on old connection"))}}sendRequest(e){const n={t:"d",d:e};this.sendData_(n)}tryCleanupConnection(){this.tx_===this.secondaryConn_&&this.rx_===this.secondaryConn_&&(this.log_("cleaning up and promoting a connection: "+this.secondaryConn_.connId),this.conn_=this.secondaryConn_,this.secondaryConn_=null)}onSecondaryControl_(e){if(Lg in e){const n=e[Lg];n===QS?this.upgradeIfSecondaryHealthy_():n===YS?(this.log_("Got a reset on secondary, closing it"),this.secondaryConn_.close(),(this.tx_===this.secondaryConn_||this.rx_===this.secondaryConn_)&&this.close()):n===XS&&(this.log_("got pong on secondary."),this.secondaryResponsesRequired_--,this.upgradeIfSecondaryHealthy_())}}onSecondaryMessageReceived_(e){const n=tc("t",e),r=tc("d",e);if(n==="c")this.onSecondaryControl_(r);else if(n==="d")this.pendingDataMessages.push(r);else throw new Error("Unknown protocol layer: "+n)}upgradeIfSecondaryHealthy_(){this.secondaryResponsesRequired_<=0?(this.log_("Secondary connection is healthy."),this.isHealthy_=!0,this.secondaryConn_.markConnectionHealthy(),this.proceedWithUpgrade_()):(this.log_("sending ping on secondary."),this.secondaryConn_.send({t:"c",d:{t:eT,d:{}}}))}proceedWithUpgrade_(){this.secondaryConn_.start(),this.log_("sending client ack on secondary"),this.secondaryConn_.send({t:"c",d:{t:QS,d:{}}}),this.log_("Ending transmission on primary"),this.conn_.send({t:"c",d:{t:ZS,d:{}}}),this.tx_=this.secondaryConn_,this.tryCleanupConnection()}onPrimaryMessageReceived_(e){const n=tc("t",e),r=tc("d",e);n==="c"?this.onControl_(r):n==="d"&&this.onDataMessage_(r)}onDataMessage_(e){this.onPrimaryResponse_(),this.onMessage_(e)}onPrimaryResponse_(){this.isHealthy_||(this.primaryResponsesRequired_--,this.primaryResponsesRequired_<=0&&(this.log_("Primary connection is healthy."),this.isHealthy_=!0,this.conn_.markConnectionHealthy()))}onControl_(e){const n=tc(Lg,e);if(JS in e){const r=e[JS];if(n===U5){const a=Object.assign({},r);this.repoInfo_.isUsingEmulator&&(a.h=this.repoInfo_.host),this.onHandshake_(a)}else if(n===ZS){this.log_("recvd end transmission on primary"),this.rx_=this.secondaryConn_;for(let a=0;a{this.secondaryConn_&&(this.log_("Timed out trying to upgrade."),this.secondaryConn_.close())},Math.floor(O5))}onReset_(e){this.log_("Reset packet received. New host: "+e),this.repoInfo_.host=e,this.state_===1?this.close():(this.closeConnections_(),this.start_())}onConnectionEstablished_(e,n){this.log_("Realtime connection established."),this.conn_=e,this.state_=1,this.onReady_&&(this.onReady_(n,this.sessionId),this.onReady_=null),this.primaryResponsesRequired_===0?(this.log_("Primary connection is healthy."),this.isHealthy_=!0):kc(()=>{this.sendPingOnPrimaryIfNecessary_()},Math.floor(M5))}sendPingOnPrimaryIfNecessary_(){!this.isHealthy_&&this.state_===1&&(this.log_("sending ping on primary."),this.sendData_({t:"c",d:{t:eT,d:{}}}))}onSecondaryConnectionLost_(){const e=this.secondaryConn_;this.secondaryConn_=null,(this.tx_===e||this.rx_===e)&&this.close()}onConnectionLost_(e){this.conn_=null,!e&&this.state_===0?(this.log_("Realtime connection failed."),this.repoInfo_.isCacheableHost()&&(Ys.remove("host:"+this.repoInfo_.host),this.repoInfo_.internalHost=this.repoInfo_.host)):this.state_===1&&this.log_("Realtime connection lost."),this.close()}onConnectionShutdown_(e){this.log_("Connection shutdown command received. Shutting down..."),this.onKill_&&(this.onKill_(e),this.onKill_=null),this.onDisconnect_=null,this.close()}sendData_(e){if(this.state_!==1)throw"Connection is not connected";this.tx_.send(e)}close(){this.state_!==2&&(this.log_("Closing realtime connection."),this.state_=2,this.closeConnections_(),this.onDisconnect_&&(this.onDisconnect_(),this.onDisconnect_=null))}closeConnections_(){this.log_("Shutting down all connections"),this.conn_&&(this.conn_.close(),this.conn_=null),this.secondaryConn_&&(this.secondaryConn_.close(),this.secondaryConn_=null),this.healthyTimeout_&&(clearTimeout(this.healthyTimeout_),this.healthyTimeout_=null)}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class AP{put(e,n,r,a){}merge(e,n,r,a){}refreshAuthToken(e){}refreshAppCheckToken(e){}onDisconnectPut(e,n,r){}onDisconnectMerge(e,n,r){}onDisconnectCancel(e,n){}reportStats(e){}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class IP{constructor(e){this.allowedEvents_=e,this.listeners_={},ce(Array.isArray(e)&&e.length>0,"Requires a non-empty array")}trigger(e,...n){if(Array.isArray(this.listeners_[e])){const r=[...this.listeners_[e]];for(let a=0;an===e),"Unknown event: "+e)}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class Mp extends IP{constructor(){super(["online"]),this.online_=!0,typeof window<"u"&&typeof window.addEventListener<"u"&&!Py()&&(window.addEventListener("online",()=>{this.online_||(this.online_=!0,this.trigger("online",!0))},!1),window.addEventListener("offline",()=>{this.online_&&(this.online_=!1,this.trigger("online",!1))},!1))}static getInstance(){return new Mp}getInitialEvent(e){return ce(e==="online","Unknown event type: "+e),[this.online_]}currentlyOnline(){return this.online_}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const tT=32,nT=768;class vt{constructor(e,n){if(n===void 0){this.pieces_=e.split("/");let r=0;for(let a=0;a0&&(this.pieces_[r]=this.pieces_[a],r++);this.pieces_.length=r,this.pieceNum_=0}else this.pieces_=e,this.pieceNum_=n}toString(){let e="";for(let n=this.pieceNum_;n=t.pieces_.length?null:t.pieces_[t.pieceNum_]}function fs(t){return t.pieces_.length-t.pieceNum_}function _t(t){let e=t.pieceNum_;return e=t.pieces_.length)return null;const e=[];for(let n=t.pieceNum_;n0&&n.push(r[a])}return new vt(n,0)}function We(t){return t.pieceNum_>=t.pieces_.length}function Kn(t,e){const n=Je(t),r=Je(e);if(n===null)return e;if(n===r)return Kn(_t(t),_t(e));throw new Error("INTERNAL ERROR: innerPath ("+e+") is not within outerPath ("+t+")")}function NP(t,e){if(fs(t)!==fs(e))return!1;for(let n=t.pieceNum_,r=e.pieceNum_;n<=t.pieces_.length;n++,r++)if(t.pieces_[n]!==e.pieces_[r])return!1;return!0}function ta(t,e){let n=t.pieceNum_,r=e.pieceNum_;if(fs(t)>fs(e))return!1;for(;n0&&(t.byteLength_+=1),t.parts_.push(e),t.byteLength_+=$0(e),OP(t)}function G5(t){const e=t.parts_.pop();t.byteLength_-=$0(e),t.parts_.length>0&&(t.byteLength_-=1)}function OP(t){if(t.byteLength_>nT)throw new Error(t.errorPrefix_+"has a key path longer than "+nT+" bytes ("+t.byteLength_+").");if(t.parts_.length>tT)throw new Error(t.errorPrefix_+"path specified exceeds the maximum depth that can be written ("+tT+") or object contains a cycle "+qs(t))}function qs(t){return t.parts_.length===0?"":"in property '"+t.parts_.join(".")+"'"}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class Uy extends IP{constructor(){super(["visible"]);let e,n;typeof document<"u"&&typeof document.addEventListener<"u"&&(typeof document.hidden<"u"?(n="visibilitychange",e="hidden"):typeof document.mozHidden<"u"?(n="mozvisibilitychange",e="mozHidden"):typeof document.msHidden<"u"?(n="msvisibilitychange",e="msHidden"):typeof document.webkitHidden<"u"&&(n="webkitvisibilitychange",e="webkitHidden")),this.visible_=!0,n&&document.addEventListener(n,()=>{const r=!document[e];r!==this.visible_&&(this.visible_=r,this.trigger("visible",r))},!1)}static getInstance(){return new Uy}getInitialEvent(e){return ce(e==="visible","Unknown event type: "+e),[this.visible_]}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const nc=1e3,H5=60*5*1e3,rT=30*1e3,W5=1.3,$5=3e4,K5="server_kill",aT=3;class Za extends AP{constructor(e,n,r,a,i,s,o,l){if(super(),this.repoInfo_=e,this.applicationId_=n,this.onDataUpdate_=r,this.onConnectStatus_=a,this.onServerInfoUpdate_=i,this.authTokenProvider_=s,this.appCheckTokenProvider_=o,this.authOverride_=l,this.id=Za.nextPersistentConnectionId_++,this.log_=nh("p:"+this.id+":"),this.interruptReasons_={},this.listens=new Map,this.outstandingPuts_=[],this.outstandingGets_=[],this.outstandingPutCount_=0,this.outstandingGetCount_=0,this.onDisconnectRequestQueue_=[],this.connected_=!1,this.reconnectDelay_=nc,this.maxReconnectDelay_=H5,this.securityDebugCallback_=null,this.lastSessionId=null,this.establishConnectionTimer_=null,this.visible_=!1,this.requestCBHash_={},this.requestNumber_=0,this.realtime_=null,this.authToken_=null,this.appCheckToken_=null,this.forceTokenRefresh_=!1,this.invalidAuthTokenCount_=0,this.invalidAppCheckTokenCount_=0,this.firstConnection_=!0,this.lastConnectionAttemptTime_=null,this.lastConnectionEstablishedTime_=null,l&&!eP())throw new Error("Auth override specified in options, but not supported on non Node.js platforms");Uy.getInstance().on("visible",this.onVisible_,this),e.host.indexOf("fblocal")===-1&&Mp.getInstance().on("online",this.onOnline_,this)}sendRequest(e,n,r){const a=++this.requestNumber_,i={r:a,a:e,b:n};this.log_(tn(i)),ce(this.connected_,"sendRequest call when we're not connected not allowed."),this.realtime_.sendRequest(i),r&&(this.requestCBHash_[a]=r)}get(e){this.initConnection_();const n=new W0,a={action:"g",request:{p:e._path.toString(),q:e._queryObject},onComplete:s=>{const o=s.d;s.s==="ok"?n.resolve(o):n.reject(o)}};this.outstandingGets_.push(a),this.outstandingGetCount_++;const i=this.outstandingGets_.length-1;return this.connected_&&this.sendGet_(i),n.promise}listen(e,n,r,a){this.initConnection_();const i=e._queryIdentifier,s=e._path.toString();this.log_("Listen called for "+s+" "+i),this.listens.has(s)||this.listens.set(s,new Map),ce(e._queryParams.isDefault()||!e._queryParams.loadsAllData(),"listen() called for non-default but complete query"),ce(!this.listens.get(s).has(i),"listen() called twice for same path/queryId.");const o={onComplete:a,hashFn:n,query:e,tag:r};this.listens.get(s).set(i,o),this.connected_&&this.sendListen_(o)}sendGet_(e){const n=this.outstandingGets_[e];this.sendRequest("g",n.request,r=>{delete this.outstandingGets_[e],this.outstandingGetCount_--,this.outstandingGetCount_===0&&(this.outstandingGets_=[]),n.onComplete&&n.onComplete(r)})}sendListen_(e){const n=e.query,r=n._path.toString(),a=n._queryIdentifier;this.log_("Listen on "+r+" for "+a);const i={p:r},s="q";e.tag&&(i.q=n._queryObject,i.t=e.tag),i.h=e.hashFn(),this.sendRequest(s,i,o=>{const l=o.d,u=o.s;Za.warnOnListenWarnings_(l,n),(this.listens.get(r)&&this.listens.get(r).get(a))===e&&(this.log_("listen response",o),u!=="ok"&&this.removeListen_(r,a),e.onComplete&&e.onComplete(u,l))})}static warnOnListenWarnings_(e,n){if(e&&typeof e=="object"&&La(e,"w")){const r=Jl(e,"w");if(Array.isArray(r)&&~r.indexOf("no_index")){const a='".indexOn": "'+n._queryParams.getIndex().toString()+'"',i=n._path.toString();sr(`Using an unspecified index. Your data will be downloaded and filtered on the client. Consider adding ${a} at ${i} to your security rules for better performance.`)}}}refreshAuthToken(e){this.authToken_=e,this.log_("Auth token refreshed"),this.authToken_?this.tryAuth():this.connected_&&this.sendRequest("unauth",{},()=>{}),this.reduceReconnectDelayIfAdminCredential_(e)}reduceReconnectDelayIfAdminCredential_(e){(e&&e.length===40||BF(e))&&(this.log_("Admin auth credential detected. Reducing max reconnect time."),this.maxReconnectDelay_=rT)}refreshAppCheckToken(e){this.appCheckToken_=e,this.log_("App check token refreshed"),this.appCheckToken_?this.tryAppCheck():this.connected_&&this.sendRequest("unappeck",{},()=>{})}tryAuth(){if(this.connected_&&this.authToken_){const e=this.authToken_,n=FF(e)?"auth":"gauth",r={cred:e};this.authOverride_===null?r.noauth=!0:typeof this.authOverride_=="object"&&(r.authvar=this.authOverride_),this.sendRequest(n,r,a=>{const i=a.s,s=a.d||"error";this.authToken_===e&&(i==="ok"?this.invalidAuthTokenCount_=0:this.onAuthRevoked_(i,s))})}}tryAppCheck(){this.connected_&&this.appCheckToken_&&this.sendRequest("appcheck",{token:this.appCheckToken_},e=>{const n=e.s,r=e.d||"error";n==="ok"?this.invalidAppCheckTokenCount_=0:this.onAppCheckRevoked_(n,r)})}unlisten(e,n){const r=e._path.toString(),a=e._queryIdentifier;this.log_("Unlisten called for "+r+" "+a),ce(e._queryParams.isDefault()||!e._queryParams.loadsAllData(),"unlisten() called for non-default but complete query"),this.removeListen_(r,a)&&this.connected_&&this.sendUnlisten_(r,a,e._queryObject,n)}sendUnlisten_(e,n,r,a){this.log_("Unlisten on "+e+" for "+n);const i={p:e},s="n";a&&(i.q=r,i.t=a),this.sendRequest(s,i)}onDisconnectPut(e,n,r){this.initConnection_(),this.connected_?this.sendOnDisconnect_("o",e,n,r):this.onDisconnectRequestQueue_.push({pathString:e,action:"o",data:n,onComplete:r})}onDisconnectMerge(e,n,r){this.initConnection_(),this.connected_?this.sendOnDisconnect_("om",e,n,r):this.onDisconnectRequestQueue_.push({pathString:e,action:"om",data:n,onComplete:r})}onDisconnectCancel(e,n){this.initConnection_(),this.connected_?this.sendOnDisconnect_("oc",e,null,n):this.onDisconnectRequestQueue_.push({pathString:e,action:"oc",data:null,onComplete:n})}sendOnDisconnect_(e,n,r,a){const i={p:n,d:r};this.log_("onDisconnect "+e,i),this.sendRequest(e,i,s=>{a&&setTimeout(()=>{a(s.s,s.d)},Math.floor(0))})}put(e,n,r,a){this.putInternal("p",e,n,r,a)}merge(e,n,r,a){this.putInternal("m",e,n,r,a)}putInternal(e,n,r,a,i){this.initConnection_();const s={p:n,d:r};i!==void 0&&(s.h=i),this.outstandingPuts_.push({action:e,request:s,onComplete:a}),this.outstandingPutCount_++;const o=this.outstandingPuts_.length-1;this.connected_?this.sendPut_(o):this.log_("Buffering put: "+n)}sendPut_(e){const n=this.outstandingPuts_[e].action,r=this.outstandingPuts_[e].request,a=this.outstandingPuts_[e].onComplete;this.outstandingPuts_[e].queued=this.connected_,this.sendRequest(n,r,i=>{this.log_(n+" response",i),delete this.outstandingPuts_[e],this.outstandingPutCount_--,this.outstandingPutCount_===0&&(this.outstandingPuts_=[]),a&&a(i.s,i.d)})}reportStats(e){if(this.connected_){const n={c:e};this.log_("reportStats",n),this.sendRequest("s",n,r=>{if(r.s!=="ok"){const i=r.d;this.log_("reportStats","Error sending stats: "+i)}})}}onDataMessage_(e){if("r"in e){this.log_("from server: "+tn(e));const n=e.r,r=this.requestCBHash_[n];r&&(delete this.requestCBHash_[n],r(e.b))}else{if("error"in e)throw"A server-side error has occurred: "+e.error;"a"in e&&this.onDataPush_(e.a,e.b)}}onDataPush_(e,n){this.log_("handleServerMessage",e,n),e==="d"?this.onDataUpdate_(n.p,n.d,!1,n.t):e==="m"?this.onDataUpdate_(n.p,n.d,!0,n.t):e==="c"?this.onListenRevoked_(n.p,n.q):e==="ac"?this.onAuthRevoked_(n.s,n.d):e==="apc"?this.onAppCheckRevoked_(n.s,n.d):e==="sd"?this.onSecurityDebugPacket_(n):w1("Unrecognized action received from server: "+tn(e)+` Are you using the latest client?`)}onReady_(e,n){this.log_("connection ready"),this.connected_=!0,this.lastConnectionEstablishedTime_=new Date().getTime(),this.handleTimestamp_(e),this.lastSessionId=n,this.firstConnection_&&this.sendConnectStats_(),this.restoreState_(),this.firstConnection_=!1,this.onConnectStatus_(!0)}scheduleConnect_(e){ce(!this.realtime_,"Scheduling a connect when we're already connected/ing?"),this.establishConnectionTimer_&&clearTimeout(this.establishConnectionTimer_),this.establishConnectionTimer_=setTimeout(()=>{this.establishConnectionTimer_=null,this.establishConnection_()},Math.floor(e))}initConnection_(){!this.realtime_&&this.firstConnection_&&this.scheduleConnect_(0)}onVisible_(e){e&&!this.visible_&&this.reconnectDelay_===this.maxReconnectDelay_&&(this.log_("Window became visible. Reducing delay."),this.reconnectDelay_=nc,this.realtime_||this.scheduleConnect_(0)),this.visible_=e}onOnline_(e){e?(this.log_("Browser went online."),this.reconnectDelay_=nc,this.realtime_||this.scheduleConnect_(0)):(this.log_("Browser went offline. Killing connection."),this.realtime_&&this.realtime_.close())}onRealtimeDisconnect_(){if(this.log_("data client disconnected"),this.connected_=!1,this.realtime_=null,this.cancelSentTransactions_(),this.requestCBHash_={},this.shouldReconnect_()){this.visible_?this.lastConnectionEstablishedTime_&&(new Date().getTime()-this.lastConnectionEstablishedTime_>$5&&(this.reconnectDelay_=nc),this.lastConnectionEstablishedTime_=null):(this.log_("Window isn't visible. Delaying reconnect."),this.reconnectDelay_=this.maxReconnectDelay_,this.lastConnectionAttemptTime_=new Date().getTime());const e=new Date().getTime()-this.lastConnectionAttemptTime_;let n=Math.max(0,this.reconnectDelay_-e);n=Math.random()*n,this.log_("Trying to reconnect in "+n+"ms"),this.scheduleConnect_(n),this.reconnectDelay_=Math.min(this.maxReconnectDelay_,this.reconnectDelay_*W5)}this.onConnectStatus_(!1)}async establishConnection_(){if(this.shouldReconnect_()){this.log_("Making a connection attempt"),this.lastConnectionAttemptTime_=new Date().getTime(),this.lastConnectionEstablishedTime_=null;const e=this.onDataMessage_.bind(this),n=this.onReady_.bind(this),r=this.onRealtimeDisconnect_.bind(this),a=this.id+":"+Za.nextConnectionId_++,i=this.lastSessionId;let s=!1,o=null;const l=function(){o?o.close():(s=!0,r())},u=function(h){ce(o,"sendRequest call when we're not connected not allowed."),o.sendRequest(h)};this.realtime_={close:l,sendRequest:u};const c=this.forceTokenRefresh_;this.forceTokenRefresh_=!1;try{const[h,f]=await Promise.all([this.authTokenProvider_.getToken(c),this.appCheckTokenProvider_.getToken(c)]);s?Fn("getToken() completed but was canceled"):(Fn("getToken() completed. Creating connection."),this.authToken_=h&&h.accessToken,this.appCheckToken_=f&&f.token,o=new V5(a,this.repoInfo_,this.applicationId_,this.appCheckToken_,this.authToken_,e,n,r,p=>{sr(p+" ("+this.repoInfo_.toString()+")"),this.interrupt(K5)},i))}catch(h){this.log_("Failed to get token: "+h),s||(this.repoInfo_.nodeAdmin&&sr(h),l())}}}interrupt(e){Fn("Interrupting connection for reason: "+e),this.interruptReasons_[e]=!0,this.realtime_?this.realtime_.close():(this.establishConnectionTimer_&&(clearTimeout(this.establishConnectionTimer_),this.establishConnectionTimer_=null),this.connected_&&this.onRealtimeDisconnect_())}resume(e){Fn("Resuming connection for reason: "+e),delete this.interruptReasons_[e],y1(this.interruptReasons_)&&(this.reconnectDelay_=nc,this.realtime_||this.scheduleConnect_(0))}handleTimestamp_(e){const n=e-new Date().getTime();this.onServerInfoUpdate_({serverTimeOffset:n})}cancelSentTransactions_(){for(let e=0;eLy(i)).join("$"):r="default";const a=this.removeListen_(e,r);a&&a.onComplete&&a.onComplete("permission_denied")}removeListen_(e,n){const r=new vt(e).toString();let a;if(this.listens.has(r)){const i=this.listens.get(r);a=i.get(n),i.delete(n),i.size===0&&this.listens.delete(r)}else a=void 0;return a}onAuthRevoked_(e,n){Fn("Auth token revoked: "+e+"/"+n),this.authToken_=null,this.forceTokenRefresh_=!0,this.realtime_.close(),(e==="invalid_token"||e==="permission_denied")&&(this.invalidAuthTokenCount_++,this.invalidAuthTokenCount_>=aT&&(this.reconnectDelay_=rT,this.authTokenProvider_.notifyForInvalidToken()))}onAppCheckRevoked_(e,n){Fn("App check token revoked: "+e+"/"+n),this.appCheckToken_=null,this.forceTokenRefresh_=!0,(e==="invalid_token"||e==="permission_denied")&&(this.invalidAppCheckTokenCount_++,this.invalidAppCheckTokenCount_>=aT&&this.appCheckTokenProvider_.notifyForInvalidToken())}onSecurityDebugPacket_(e){this.securityDebugCallback_?this.securityDebugCallback_(e):"msg"in e&&console.log("FIREBASE: "+e.msg.replace(` `,` FIREBASE: `))}restoreState_(){this.tryAuth(),this.tryAppCheck();for(const e of this.listens.values())for(const n of e.values())this.sendListen_(n);for(let e=0;e0}peek(){if(this.nodeStack_.length===0)return null;const e=this.nodeStack_[this.nodeStack_.length-1];return this.resultGenerator_?this.resultGenerator_(e.key,e.value):{key:e.key,value:e.value}}},_r=class pc{constructor(e,n,r,a,i){this.key=e,this.value=n,this.color=r??pc.RED,this.left=a??ba.EMPTY_NODE,this.right=i??ba.EMPTY_NODE}copy(e,n,r,a,i){return new pc(e??this.key,n??this.value,r??this.color,a??this.left,i??this.right)}count(){return this.left.count()+1+this.right.count()}isEmpty(){return!1}inorderTraversal(e){return this.left.inorderTraversal(e)||!!e(this.key,this.value)||this.right.inorderTraversal(e)}reverseTraversal(e){return this.right.reverseTraversal(e)||e(this.key,this.value)||this.left.reverseTraversal(e)}min_(){return this.left.isEmpty()?this:this.left.min_()}minKey(){return this.min_().key}maxKey(){return this.right.isEmpty()?this.key:this.right.maxKey()}insert(e,n,r){let a=this;const i=r(e,a.key);return i<0?a=a.copy(null,null,null,a.left.insert(e,n,r),null):i===0?a=a.copy(null,n,null,null,null):a=a.copy(null,null,null,null,a.right.insert(e,n,r)),a.fixUp_()}removeMin_(){if(this.left.isEmpty())return ba.EMPTY_NODE;let e=this;return!e.left.isRed_()&&!e.left.left.isRed_()&&(e=e.moveRedLeft_()),e=e.copy(null,null,null,e.left.removeMin_(),null),e.fixUp_()}remove(e,n){let r,a;if(r=this,n(e,r.key)<0)!r.left.isEmpty()&&!r.left.isRed_()&&!r.left.left.isRed_()&&(r=r.moveRedLeft_()),r=r.copy(null,null,null,r.left.remove(e,n),null);else{if(r.left.isRed_()&&(r=r.rotateRight_()),!r.right.isEmpty()&&!r.right.isRed_()&&!r.right.left.isRed_()&&(r=r.moveRedRight_()),n(e,r.key)===0){if(r.right.isEmpty())return ba.EMPTY_NODE;a=r.right.min_(),r=r.copy(a.key,a.value,null,null,r.right.removeMin_())}r=r.copy(null,null,null,null,r.right.remove(e,n))}return r.fixUp_()}isRed_(){return this.color}fixUp_(){let e=this;return e.right.isRed_()&&!e.left.isRed_()&&(e=e.rotateLeft_()),e.left.isRed_()&&e.left.left.isRed_()&&(e=e.rotateRight_()),e.left.isRed_()&&e.right.isRed_()&&(e=e.colorFlip_()),e}moveRedLeft_(){let e=this.colorFlip_();return e.right.left.isRed_()&&(e=e.copy(null,null,null,null,e.right.rotateRight_()),e=e.rotateLeft_(),e=e.colorFlip_()),e}moveRedRight_(){let e=this.colorFlip_();return e.left.left.isRed_()&&(e=e.rotateRight_(),e=e.colorFlip_()),e}rotateLeft_(){const e=this.copy(null,null,pc.RED,null,this.right.left);return this.right.copy(null,null,this.color,e,null)}rotateRight_(){const e=this.copy(null,null,pc.RED,this.left.right,null);return this.left.copy(null,null,this.color,null,e)}colorFlip_(){const e=this.left.copy(null,null,!this.left.color,null,null),n=this.right.copy(null,null,!this.right.color,null,null);return this.copy(null,null,!this.color,e,n)}checkMaxDepth_(){const e=this.check_();return Math.pow(2,e)<=this.count()+1}check_(){if(this.isRed_()&&this.left.isRed_())throw new Error("Red node has red child("+this.key+","+this.value+")");if(this.right.isRed_())throw new Error("Right child of ("+this.key+","+this.value+") is red");const e=this.left.check_();if(e!==this.right.check_())throw new Error("Black depths differ");return e+(this.isRed_()?0:1)}};_r.RED=!0;_r.BLACK=!1;class J5{copy(e,n,r,a,i){return this}insert(e,n,r){return new _r(e,n,null)}remove(e,n){return this}count(){return 0}isEmpty(){return!0}inorderTraversal(e){return!1}reverseTraversal(e){return!1}minKey(){return null}maxKey(){return null}check_(){return 0}isRed_(){return!1}}let ba=class jf{constructor(e,n=jf.EMPTY_NODE){this.comparator_=e,this.root_=n}insert(e,n){return new jf(this.comparator_,this.root_.insert(e,n,this.comparator_).copy(null,null,_r.BLACK,null,null))}remove(e){return new jf(this.comparator_,this.root_.remove(e,this.comparator_).copy(null,null,_r.BLACK,null,null))}get(e){let n,r=this.root_;for(;!r.isEmpty();){if(n=this.comparator_(e,r.key),n===0)return r.value;n<0?r=r.left:n>0&&(r=r.right)}return null}getPredecessorKey(e){let n,r=this.root_,a=null;for(;!r.isEmpty();)if(n=this.comparator_(e,r.key),n===0){if(r.left.isEmpty())return a?a.key:null;for(r=r.left;!r.right.isEmpty();)r=r.right;return r.key}else n<0?r=r.left:n>0&&(a=r,r=r.right);throw new Error("Attempted to find predecessor key for a nonexistent key. What gives?")}isEmpty(){return this.root_.isEmpty()}count(){return this.root_.count()}minKey(){return this.root_.minKey()}maxKey(){return this.root_.maxKey()}inorderTraversal(e){return this.root_.inorderTraversal(e)}reverseTraversal(e){return this.root_.reverseTraversal(e)}getIterator(e){return new lf(this.root_,null,this.comparator_,!1,e)}getIteratorFrom(e,n){return new lf(this.root_,e,this.comparator_,!1,n)}getReverseIteratorFrom(e,n){return new lf(this.root_,e,this.comparator_,!0,n)}getReverseIterator(e){return new lf(this.root_,null,this.comparator_,!0,e)}};ba.EMPTY_NODE=new J5;/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function Y5(t,e){return gu(t.name,e.name)}function Vy(t,e){return gu(t,e)}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */let A1;function X5(t){A1=t}const LP=function(t){return typeof t=="number"?"number:"+cP(t):"string:"+t},DP=function(t){if(t.isLeafNode()){const e=t.val();ce(typeof e=="string"||typeof e=="number"||typeof e=="object"&&La(e,".sv"),"Priority must be a string or number.")}else ce(t===A1||t.isEmpty(),"priority of unexpected type.");ce(t===A1||t.getPriority().isEmpty(),"Priority nodes can't have a priority of their own.")};/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */let iT;class sn{constructor(e,n=sn.__childrenNodeConstructor.EMPTY_NODE){this.value_=e,this.priorityNode_=n,this.lazyHash_=null,ce(this.value_!==void 0&&this.value_!==null,"LeafNode shouldn't be created with null/undefined value."),DP(this.priorityNode_)}static set __childrenNodeConstructor(e){iT=e}static get __childrenNodeConstructor(){return iT}isLeafNode(){return!0}getPriority(){return this.priorityNode_}updatePriority(e){return new sn(this.value_,e)}getImmediateChild(e){return e===".priority"?this.priorityNode_:sn.__childrenNodeConstructor.EMPTY_NODE}getChild(e){return We(e)?this:Je(e)===".priority"?this.priorityNode_:sn.__childrenNodeConstructor.EMPTY_NODE}hasChild(){return!1}getPredecessorChildName(e,n){return null}updateImmediateChild(e,n){return e===".priority"?this.updatePriority(n):n.isEmpty()&&e!==".priority"?this:sn.__childrenNodeConstructor.EMPTY_NODE.updateImmediateChild(e,n).updatePriority(this.priorityNode_)}updateChild(e,n){const r=Je(e);return r===null?n:n.isEmpty()&&r!==".priority"?this:(ce(r!==".priority"||fs(e)===1,".priority must be the last token in a path"),this.updateImmediateChild(r,sn.__childrenNodeConstructor.EMPTY_NODE.updateChild(_t(e),n)))}isEmpty(){return!1}numChildren(){return 0}forEachChild(e,n){return!1}val(e){return e&&!this.getPriority().isEmpty()?{".value":this.getValue(),".priority":this.getPriority().val()}:this.getValue()}hash(){if(this.lazyHash_===null){let e="";this.priorityNode_.isEmpty()||(e+="priority:"+LP(this.priorityNode_.val())+":");const n=typeof this.value_;e+=n+":",n==="number"?e+=cP(this.value_):e+=this.value_,this.lazyHash_=lP(e)}return this.lazyHash_}getValue(){return this.value_}compareTo(e){return e===sn.__childrenNodeConstructor.EMPTY_NODE?1:e instanceof sn.__childrenNodeConstructor?-1:(ce(e.isLeafNode(),"Unknown node type"),this.compareToLeafNode_(e))}compareToLeafNode_(e){const n=typeof e.value_,r=typeof this.value_,a=sn.VALUE_TYPE_ORDER.indexOf(n),i=sn.VALUE_TYPE_ORDER.indexOf(r);return ce(a>=0,"Unknown leaf type: "+n),ce(i>=0,"Unknown leaf type: "+r),a===i?r==="object"?0:this.value_parseInt(Math.log(i)/t8,10),r=i=>parseInt(Array(i+1).join("1"),2);this.count=n(e+1),this.current_=this.count-1;const a=r(this.count);this.bits_=e+1&a}nextBitIsOne(){const e=!(this.bits_&1<{const s=Jl(this.indexSet_,i);if(ce(s,"Missing index implementation for "+i),a===Qo)if(s.isDefinedOn(e.node)){const o=[],l=n.getIterator(qe.Wrap);let u=l.getNext();for(;u;)u.name!==e.name&&o.push(u),u=l.getNext();return o.push(e),Lp(o,s.getCompare())}else return Qo;else{const o=n.get(e.name);let l=a;return o&&(l=l.remove(new qe(e.name,o))),l.insert(e,e.node)}});return new Ka(r,this.indexSet_)}removeFromIndexes(e,n){const r=Rp(this.indexes_,a=>{if(a===Qo)return a;{const i=n.get(e.name);return i?a.remove(new qe(e.name,i)):a}});return new Ka(r,this.indexSet_)}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */let rc;class Oe{constructor(e,n,r){this.children_=e,this.priorityNode_=n,this.indexMap_=r,this.lazyHash_=null,this.priorityNode_&&DP(this.priorityNode_),this.children_.isEmpty()&&ce(!this.priorityNode_||this.priorityNode_.isEmpty(),"An empty node cannot have a priority")}static get EMPTY_NODE(){return rc||(rc=new Oe(new ba(Vy),null,Ka.Default))}isLeafNode(){return!1}getPriority(){return this.priorityNode_||rc}updatePriority(e){return this.children_.isEmpty()?this:new Oe(this.children_,e,this.indexMap_)}getImmediateChild(e){if(e===".priority")return this.getPriority();{const n=this.children_.get(e);return n===null?rc:n}}getChild(e){const n=Je(e);return n===null?this:this.getImmediateChild(n).getChild(_t(e))}hasChild(e){return this.children_.get(e)!==null}updateImmediateChild(e,n){if(ce(n,"We should always be passing snapshot nodes"),e===".priority")return this.updatePriority(n);{const r=new qe(e,n);let a,i;n.isEmpty()?(a=this.children_.remove(e),i=this.indexMap_.removeFromIndexes(r,this.children_)):(a=this.children_.insert(e,n),i=this.indexMap_.addToIndexes(r,this.children_));const s=a.isEmpty()?rc:this.priorityNode_;return new Oe(a,s,i)}}updateChild(e,n){const r=Je(e);if(r===null)return n;{ce(Je(e)!==".priority"||fs(e)===1,".priority must be the last token in a path");const a=this.getImmediateChild(r).updateChild(_t(e),n);return this.updateImmediateChild(r,a)}}isEmpty(){return this.children_.isEmpty()}numChildren(){return this.children_.count()}val(e){if(this.isEmpty())return null;const n={};let r=0,a=0,i=!0;if(this.forEachChild(kt,(s,o)=>{n[s]=o.val(e),r++,i&&Oe.INTEGER_REGEXP_.test(s)?a=Math.max(a,Number(s)):i=!1}),!e&&i&&a<2*r){const s=[];for(const o in n)s[o]=n[o];return s}else return e&&!this.getPriority().isEmpty()&&(n[".priority"]=this.getPriority().val()),n}hash(){if(this.lazyHash_===null){let e="";this.getPriority().isEmpty()||(e+="priority:"+LP(this.getPriority().val())+":"),this.forEachChild(kt,(n,r)=>{const a=r.hash();a!==""&&(e+=":"+n+":"+a)}),this.lazyHash_=e===""?"":lP(e)}return this.lazyHash_}getPredecessorChildName(e,n,r){const a=this.resolveIndex_(r);if(a){const i=a.getPredecessorKey(new qe(e,n));return i?i.name:null}else return this.children_.getPredecessorKey(e)}getFirstChildName(e){const n=this.resolveIndex_(e);if(n){const r=n.minKey();return r&&r.name}else return this.children_.minKey()}getFirstChild(e){const n=this.getFirstChildName(e);return n?new qe(n,this.children_.get(n)):null}getLastChildName(e){const n=this.resolveIndex_(e);if(n){const r=n.maxKey();return r&&r.name}else return this.children_.maxKey()}getLastChild(e){const n=this.getLastChildName(e);return n?new qe(n,this.children_.get(n)):null}forEachChild(e,n){const r=this.resolveIndex_(e);return r?r.inorderTraversal(a=>n(a.name,a.node)):this.children_.inorderTraversal(n)}getIterator(e){return this.getIteratorFrom(e.minPost(),e)}getIteratorFrom(e,n){const r=this.resolveIndex_(n);if(r)return r.getIteratorFrom(e,a=>a);{const a=this.children_.getIteratorFrom(e.name,qe.Wrap);let i=a.peek();for(;i!=null&&n.compare(i,e)<0;)a.getNext(),i=a.peek();return a}}getReverseIterator(e){return this.getReverseIteratorFrom(e.maxPost(),e)}getReverseIteratorFrom(e,n){const r=this.resolveIndex_(n);if(r)return r.getReverseIteratorFrom(e,a=>a);{const a=this.children_.getReverseIteratorFrom(e.name,qe.Wrap);let i=a.peek();for(;i!=null&&n.compare(i,e)>0;)a.getNext(),i=a.peek();return a}}compareTo(e){return this.isEmpty()?e.isEmpty()?0:-1:e.isLeafNode()||e.isEmpty()?1:e===rh?-1:0}withIndex(e){if(e===no||this.indexMap_.hasIndex(e))return this;{const n=this.indexMap_.addIndex(e,this.children_);return new Oe(this.children_,this.priorityNode_,n)}}isIndexed(e){return e===no||this.indexMap_.hasIndex(e)}equals(e){if(e===this)return!0;if(e.isLeafNode())return!1;{const n=e;if(this.getPriority().equals(n.getPriority()))if(this.children_.count()===n.children_.count()){const r=this.getIterator(kt),a=n.getIterator(kt);let i=r.getNext(),s=a.getNext();for(;i&&s;){if(i.name!==s.name||!i.node.equals(s.node))return!1;i=r.getNext(),s=a.getNext()}return i===null&&s===null}else return!1;else return!1}}resolveIndex_(e){return e===no?null:this.indexMap_.get(e.toString())}}Oe.INTEGER_REGEXP_=/^(0|[1-9]\d*)$/;class r8 extends Oe{constructor(){super(new ba(Vy),Oe.EMPTY_NODE,Ka.Default)}compareTo(e){return e===this?0:1}equals(e){return e===this}getPriority(){return this}getImmediateChild(e){return Oe.EMPTY_NODE}isEmpty(){return!1}}const rh=new r8;Object.defineProperties(qe,{MIN:{value:new qe(_o,Oe.EMPTY_NODE)},MAX:{value:new qe(hs,rh)}});MP.__EMPTY_NODE=Oe.EMPTY_NODE;sn.__childrenNodeConstructor=Oe;X5(rh);Z5(rh);/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const a8=!0;function un(t,e=null){if(t===null)return Oe.EMPTY_NODE;if(typeof t=="object"&&".priority"in t&&(e=t[".priority"]),ce(e===null||typeof e=="string"||typeof e=="number"||typeof e=="object"&&".sv"in e,"Invalid priority type found: "+typeof e),typeof t=="object"&&".value"in t&&t[".value"]!==null&&(t=t[".value"]),typeof t!="object"||".sv"in t){const n=t;return new sn(n,un(e))}if(!(t instanceof Array)&&a8){const n=[];let r=!1;if(cr(t,(s,o)=>{if(s.substring(0,1)!=="."){const l=un(o);l.isEmpty()||(r=r||!l.getPriority().isEmpty(),n.push(new qe(s,l)))}}),n.length===0)return Oe.EMPTY_NODE;const i=Lp(n,Y5,s=>s.name,Vy);if(r){const s=Lp(n,kt.getCompare());return new Oe(i,un(e),new Ka({".priority":s},{".priority":kt}))}else return new Oe(i,un(e),Ka.Default)}else{let n=Oe.EMPTY_NODE;return cr(t,(r,a)=>{if(La(t,r)&&r.substring(0,1)!=="."){const i=un(a);(i.isLeafNode()||!i.isEmpty())&&(n=n.updateImmediateChild(r,i))}}),n.updatePriority(un(e))}}Q5(un);/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class UP extends Y0{constructor(e){super(),this.indexPath_=e,ce(!We(e)&&Je(e)!==".priority","Can't create PathIndex with empty path or .priority key")}extractChild(e){return e.getChild(this.indexPath_)}isDefinedOn(e){return!e.getChild(this.indexPath_).isEmpty()}compare(e,n){const r=this.extractChild(e.node),a=this.extractChild(n.node),i=r.compareTo(a);return i===0?gu(e.name,n.name):i}makePost(e,n){const r=un(e),a=Oe.EMPTY_NODE.updateChild(this.indexPath_,r);return new qe(n,a)}maxPost(){const e=Oe.EMPTY_NODE.updateChild(this.indexPath_,rh);return new qe(hs,e)}toString(){return RP(this.indexPath_,0).join("/")}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class i8 extends Y0{compare(e,n){const r=e.node.compareTo(n.node);return r===0?gu(e.name,n.name):r}isDefinedOn(e){return!0}indexedValueChanged(e,n){return!e.equals(n)}minPost(){return qe.MIN}maxPost(){return qe.MAX}makePost(e,n){const r=un(e);return new qe(n,r)}toString(){return".value"}}const jy=new i8;/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function VP(t){return{type:"value",snapshotNode:t}}function Yl(t,e){return{type:"child_added",snapshotNode:e,childName:t}}function vd(t,e){return{type:"child_removed",snapshotNode:e,childName:t}}function _d(t,e,n){return{type:"child_changed",snapshotNode:e,childName:t,oldSnap:n}}function s8(t,e){return{type:"child_moved",snapshotNode:e,childName:t}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class zy{constructor(e){this.index_=e}updateChild(e,n,r,a,i,s){ce(e.isIndexed(this.index_),"A node must be indexed if only a child is updated");const o=e.getImmediateChild(n);return o.getChild(a).equals(r.getChild(a))&&o.isEmpty()===r.isEmpty()||(s!=null&&(r.isEmpty()?e.hasChild(n)?s.trackChildChange(vd(n,o)):ce(e.isLeafNode(),"A child remove without an old child only makes sense on a leaf node"):o.isEmpty()?s.trackChildChange(Yl(n,r)):s.trackChildChange(_d(n,r,o))),e.isLeafNode()&&r.isEmpty())?e:e.updateImmediateChild(n,r).withIndex(this.index_)}updateFullNode(e,n,r){return r!=null&&(e.isLeafNode()||e.forEachChild(kt,(a,i)=>{n.hasChild(a)||r.trackChildChange(vd(a,i))}),n.isLeafNode()||n.forEachChild(kt,(a,i)=>{if(e.hasChild(a)){const s=e.getImmediateChild(a);s.equals(i)||r.trackChildChange(_d(a,i,s))}else r.trackChildChange(Yl(a,i))})),n.withIndex(this.index_)}updatePriority(e,n){return e.isEmpty()?Oe.EMPTY_NODE:e.updatePriority(n)}filtersNodes(){return!1}getIndexedFilter(){return this}getIndex(){return this.index_}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class yd{constructor(e){this.indexedFilter_=new zy(e.getIndex()),this.index_=e.getIndex(),this.startPost_=yd.getStartPost_(e),this.endPost_=yd.getEndPost_(e),this.startIsInclusive_=!e.startAfterSet_,this.endIsInclusive_=!e.endBeforeSet_}getStartPost(){return this.startPost_}getEndPost(){return this.endPost_}matches(e){const n=this.startIsInclusive_?this.index_.compare(this.getStartPost(),e)<=0:this.index_.compare(this.getStartPost(),e)<0,r=this.endIsInclusive_?this.index_.compare(e,this.getEndPost())<=0:this.index_.compare(e,this.getEndPost())<0;return n&&r}updateChild(e,n,r,a,i,s){return this.matches(new qe(n,r))||(r=Oe.EMPTY_NODE),this.indexedFilter_.updateChild(e,n,r,a,i,s)}updateFullNode(e,n,r){n.isLeafNode()&&(n=Oe.EMPTY_NODE);let a=n.withIndex(this.index_);a=a.updatePriority(Oe.EMPTY_NODE);const i=this;return n.forEachChild(kt,(s,o)=>{i.matches(new qe(s,o))||(a=a.updateImmediateChild(s,Oe.EMPTY_NODE))}),this.indexedFilter_.updateFullNode(e,a,r)}updatePriority(e,n){return e}filtersNodes(){return!0}getIndexedFilter(){return this.indexedFilter_}getIndex(){return this.index_}static getStartPost_(e){if(e.hasStart()){const n=e.getIndexStartName();return e.getIndex().makePost(e.getIndexStartValue(),n)}else return e.getIndex().minPost()}static getEndPost_(e){if(e.hasEnd()){const n=e.getIndexEndName();return e.getIndex().makePost(e.getIndexEndValue(),n)}else return e.getIndex().maxPost()}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class o8{constructor(e){this.withinDirectionalStart=n=>this.reverse_?this.withinEndPost(n):this.withinStartPost(n),this.withinDirectionalEnd=n=>this.reverse_?this.withinStartPost(n):this.withinEndPost(n),this.withinStartPost=n=>{const r=this.index_.compare(this.rangedFilter_.getStartPost(),n);return this.startIsInclusive_?r<=0:r<0},this.withinEndPost=n=>{const r=this.index_.compare(n,this.rangedFilter_.getEndPost());return this.endIsInclusive_?r<=0:r<0},this.rangedFilter_=new yd(e),this.index_=e.getIndex(),this.limit_=e.getLimit(),this.reverse_=!e.isViewFromLeft(),this.startIsInclusive_=!e.startAfterSet_,this.endIsInclusive_=!e.endBeforeSet_}updateChild(e,n,r,a,i,s){return this.rangedFilter_.matches(new qe(n,r))||(r=Oe.EMPTY_NODE),e.getImmediateChild(n).equals(r)?e:e.numChildren()h(p,f)}else s=this.index_.getCompare();const o=e;ce(o.numChildren()===this.limit_,"");const l=new qe(n,r),u=this.reverse_?o.getFirstChild(this.index_):o.getLastChild(this.index_),c=this.rangedFilter_.matches(l);if(o.hasChild(n)){const h=o.getImmediateChild(n);let f=a.getChildAfterChild(this.index_,u,this.reverse_);for(;f!=null&&(f.name===n||o.hasChild(f.name));)f=a.getChildAfterChild(this.index_,f,this.reverse_);const p=f==null?1:s(f,l);if(c&&!r.isEmpty()&&p>=0)return i!=null&&i.trackChildChange(_d(n,r,h)),o.updateImmediateChild(n,r);{i!=null&&i.trackChildChange(vd(n,h));const m=o.updateImmediateChild(n,Oe.EMPTY_NODE);return f!=null&&this.rangedFilter_.matches(f)?(i!=null&&i.trackChildChange(Yl(f.name,f.node)),m.updateImmediateChild(f.name,f.node)):m}}else return r.isEmpty()?e:c&&s(u,l)>=0?(i!=null&&(i.trackChildChange(vd(u.name,u.node)),i.trackChildChange(Yl(n,r))),o.updateImmediateChild(n,r).updateImmediateChild(u.name,Oe.EMPTY_NODE)):e}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class qy{constructor(){this.limitSet_=!1,this.startSet_=!1,this.startNameSet_=!1,this.startAfterSet_=!1,this.endSet_=!1,this.endNameSet_=!1,this.endBeforeSet_=!1,this.limit_=0,this.viewFrom_="",this.indexStartValue_=null,this.indexStartName_="",this.indexEndValue_=null,this.indexEndName_="",this.index_=kt}hasStart(){return this.startSet_}isViewFromLeft(){return this.viewFrom_===""?this.startSet_:this.viewFrom_==="l"}getIndexStartValue(){return ce(this.startSet_,"Only valid if start has been set"),this.indexStartValue_}getIndexStartName(){return ce(this.startSet_,"Only valid if start has been set"),this.startNameSet_?this.indexStartName_:_o}hasEnd(){return this.endSet_}getIndexEndValue(){return ce(this.endSet_,"Only valid if end has been set"),this.indexEndValue_}getIndexEndName(){return ce(this.endSet_,"Only valid if end has been set"),this.endNameSet_?this.indexEndName_:hs}hasLimit(){return this.limitSet_}hasAnchoredLimit(){return this.limitSet_&&this.viewFrom_!==""}getLimit(){return ce(this.limitSet_,"Only valid if limit has been set"),this.limit_}getIndex(){return this.index_}loadsAllData(){return!(this.startSet_||this.endSet_||this.limitSet_)}isDefault(){return this.loadsAllData()&&this.index_===kt}copy(){const e=new qy;return e.limitSet_=this.limitSet_,e.limit_=this.limit_,e.startSet_=this.startSet_,e.startAfterSet_=this.startAfterSet_,e.indexStartValue_=this.indexStartValue_,e.startNameSet_=this.startNameSet_,e.indexStartName_=this.indexStartName_,e.endSet_=this.endSet_,e.endBeforeSet_=this.endBeforeSet_,e.indexEndValue_=this.indexEndValue_,e.endNameSet_=this.endNameSet_,e.indexEndName_=this.indexEndName_,e.index_=this.index_,e.viewFrom_=this.viewFrom_,e}}function l8(t){return t.loadsAllData()?new zy(t.getIndex()):t.hasLimit()?new o8(t):new yd(t)}function u8(t,e,n){const r=t.copy();return r.startSet_=!0,e===void 0&&(e=null),r.indexStartValue_=e,n!=null?(r.startNameSet_=!0,r.indexStartName_=n):(r.startNameSet_=!1,r.indexStartName_=""),r}function c8(t,e,n){const r=t.copy();return r.endSet_=!0,e===void 0&&(e=null),r.indexEndValue_=e,n!==void 0?(r.endNameSet_=!0,r.indexEndName_=n):(r.endNameSet_=!1,r.indexEndName_=""),r}function d8(t,e){const n=t.copy();return n.index_=e,n}function sT(t){const e={};if(t.isDefault())return e;let n;if(t.index_===kt?n="$priority":t.index_===jy?n="$value":t.index_===no?n="$key":(ce(t.index_ instanceof UP,"Unrecognized index type!"),n=t.index_.toString()),e.orderBy=tn(n),t.startSet_){const r=t.startAfterSet_?"startAfter":"startAt";e[r]=tn(t.indexStartValue_),t.startNameSet_&&(e[r]+=","+tn(t.indexStartName_))}if(t.endSet_){const r=t.endBeforeSet_?"endBefore":"endAt";e[r]=tn(t.indexEndValue_),t.endNameSet_&&(e[r]+=","+tn(t.indexEndName_))}return t.limitSet_&&(t.isViewFromLeft()?e.limitToFirst=t.limit_:e.limitToLast=t.limit_),e}function oT(t){const e={};if(t.startSet_&&(e.sp=t.indexStartValue_,t.startNameSet_&&(e.sn=t.indexStartName_),e.sin=!t.startAfterSet_),t.endSet_&&(e.ep=t.indexEndValue_,t.endNameSet_&&(e.en=t.indexEndName_),e.ein=!t.endBeforeSet_),t.limitSet_){e.l=t.limit_;let n=t.viewFrom_;n===""&&(t.isViewFromLeft()?n="l":n="r"),e.vf=n}return t.index_!==kt&&(e.i=t.index_.toString()),e}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class Dp extends AP{constructor(e,n,r,a){super(),this.repoInfo_=e,this.onDataUpdate_=n,this.authTokenProvider_=r,this.appCheckTokenProvider_=a,this.log_=nh("p:rest:"),this.listens_={}}reportStats(e){throw new Error("Method not implemented.")}static getListenId_(e,n){return n!==void 0?"tag$"+n:(ce(e._queryParams.isDefault(),"should have a tag if it's not a default query."),e._path.toString())}listen(e,n,r,a){const i=e._path.toString();this.log_("Listen called for "+i+" "+e._queryIdentifier);const s=Dp.getListenId_(e,r),o={};this.listens_[s]=o;const l=sT(e._queryParams);this.restRequest_(i+".json",l,(u,c)=>{let h=c;if(u===404&&(h=null,u=null),u===null&&this.onDataUpdate_(i,h,!1,r),Jl(this.listens_,s)===o){let f;u?u===401?f="permission_denied":f="rest_error:"+u:f="ok",a(f,null)}})}unlisten(e,n){const r=Dp.getListenId_(e,n);delete this.listens_[r]}get(e){const n=sT(e._queryParams),r=e._path.toString(),a=new W0;return this.restRequest_(r+".json",n,(i,s)=>{let o=s;i===404&&(o=null,i=null),i===null?(this.onDataUpdate_(r,o,!1,null),a.resolve(o)):a.reject(new Error(o))}),a.promise}refreshAuthToken(e){}restRequest_(e,n={},r){return n.format="export",Promise.all([this.authTokenProvider_.getToken(!1),this.appCheckTokenProvider_.getToken(!1)]).then(([a,i])=>{a&&a.accessToken&&(n.auth=a.accessToken),i&&i.token&&(n.ac=i.token);const s=(this.repoInfo_.secure?"https://":"http://")+this.repoInfo_.host+e+"?ns="+this.repoInfo_.namespace+mu(n);this.log_("Sending REST request for "+s);const o=new XMLHttpRequest;o.onreadystatechange=()=>{if(r&&o.readyState===4){this.log_("REST Response for "+s+" received. status:",o.status,"response:",o.responseText);let l=null;if(o.status>=200&&o.status<300){try{l=pd(o.responseText)}catch{sr("Failed to parse JSON response for "+s+": "+o.responseText)}r(null,l)}else o.status!==401&&o.status!==404&&sr("Got unsuccessful REST response for "+s+" Status: "+o.status),r(o.status);r=null}},o.open("GET",s,!0),o.send()})}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class h8{constructor(){this.rootNode_=Oe.EMPTY_NODE}getNode(e){return this.rootNode_.getChild(e)}updateSnapshot(e,n){this.rootNode_=this.rootNode_.updateChild(e,n)}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function Fp(){return{value:null,children:new Map}}function jP(t,e,n){if(We(e))t.value=n,t.children.clear();else if(t.value!==null)t.value=t.value.updateChild(e,n);else{const r=Je(e);t.children.has(r)||t.children.set(r,Fp());const a=t.children.get(r);e=_t(e),jP(a,e,n)}}function I1(t,e,n){t.value!==null?n(e,t.value):f8(t,(r,a)=>{const i=new vt(e.toString()+"/"+r);I1(a,i,n)})}function f8(t,e){t.children.forEach((n,r)=>{e(r,n)})}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class p8{constructor(e){this.collection_=e,this.last_=null}get(){const e=this.collection_.get(),n=Object.assign({},e);return this.last_&&cr(this.last_,(r,a)=>{n[r]=n[r]-a}),this.last_=e,n}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const lT=10*1e3,m8=30*1e3,g8=5*60*1e3;class v8{constructor(e,n){this.server_=n,this.statsToReport_={},this.statsListener_=new p8(e);const r=lT+(m8-lT)*Math.random();kc(this.reportStats_.bind(this),Math.floor(r))}reportStats_(){const e=this.statsListener_.get(),n={};let r=!1;cr(e,(a,i)=>{i>0&&La(this.statsToReport_,a)&&(n[a]=i,r=!0)}),r&&this.server_.reportStats(n),kc(this.reportStats_.bind(this),Math.floor(Math.random()*2*g8))}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */var na;(function(t){t[t.OVERWRITE=0]="OVERWRITE",t[t.MERGE=1]="MERGE",t[t.ACK_USER_WRITE=2]="ACK_USER_WRITE",t[t.LISTEN_COMPLETE=3]="LISTEN_COMPLETE"})(na||(na={}));function zP(){return{fromUser:!0,fromServer:!1,queryId:null,tagged:!1}}function Gy(){return{fromUser:!1,fromServer:!0,queryId:null,tagged:!1}}function Hy(t){return{fromUser:!1,fromServer:!0,queryId:t,tagged:!0}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class Bp{constructor(e,n,r){this.path=e,this.affectedTree=n,this.revert=r,this.type=na.ACK_USER_WRITE,this.source=zP()}operationForChild(e){if(We(this.path)){if(this.affectedTree.value!=null)return ce(this.affectedTree.children.isEmpty(),"affectedTree should not have overlapping affected paths."),this;{const n=this.affectedTree.subtree(new vt(e));return new Bp(at(),n,this.revert)}}else return ce(Je(this.path)===e,"operationForChild called for unrelated child."),new Bp(_t(this.path),this.affectedTree,this.revert)}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class Ed{constructor(e,n){this.source=e,this.path=n,this.type=na.LISTEN_COMPLETE}operationForChild(e){return We(this.path)?new Ed(this.source,at()):new Ed(this.source,_t(this.path))}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class yo{constructor(e,n,r){this.source=e,this.path=n,this.snap=r,this.type=na.OVERWRITE}operationForChild(e){return We(this.path)?new yo(this.source,at(),this.snap.getImmediateChild(e)):new yo(this.source,_t(this.path),this.snap)}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class bd{constructor(e,n,r){this.source=e,this.path=n,this.children=r,this.type=na.MERGE}operationForChild(e){if(We(this.path)){const n=this.children.subtree(new vt(e));return n.isEmpty()?null:n.value?new yo(this.source,at(),n.value):new bd(this.source,at(),n)}else return ce(Je(this.path)===e,"Can't get a merge for a child not on the path of the operation"),new bd(this.source,_t(this.path),this.children)}toString(){return"Operation("+this.path+": "+this.source.toString()+" merge: "+this.children.toString()+")"}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class ps{constructor(e,n,r){this.node_=e,this.fullyInitialized_=n,this.filtered_=r}isFullyInitialized(){return this.fullyInitialized_}isFiltered(){return this.filtered_}isCompleteForPath(e){if(We(e))return this.isFullyInitialized()&&!this.filtered_;const n=Je(e);return this.isCompleteForChild(n)}isCompleteForChild(e){return this.isFullyInitialized()&&!this.filtered_||this.node_.hasChild(e)}getNode(){return this.node_}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class _8{constructor(e){this.query_=e,this.index_=this.query_._queryParams.getIndex()}}function y8(t,e,n,r){const a=[],i=[];return e.forEach(s=>{s.type==="child_changed"&&t.index_.indexedValueChanged(s.oldSnap,s.snapshotNode)&&i.push(s8(s.childName,s.snapshotNode))}),ac(t,a,"child_removed",e,r,n),ac(t,a,"child_added",e,r,n),ac(t,a,"child_moved",i,r,n),ac(t,a,"child_changed",e,r,n),ac(t,a,"value",e,r,n),a}function ac(t,e,n,r,a,i){const s=r.filter(o=>o.type===n);s.sort((o,l)=>b8(t,o,l)),s.forEach(o=>{const l=E8(t,o,i);a.forEach(u=>{u.respondsTo(o.type)&&e.push(u.createEvent(l,t.query_))})})}function E8(t,e,n){return e.type==="value"||e.type==="child_removed"||(e.prevName=n.getPredecessorChildName(e.childName,e.snapshotNode,t.index_)),e}function b8(t,e,n){if(e.childName==null||n.childName==null)throw pu("Should only compare child_ events.");const r=new qe(e.childName,e.snapshotNode),a=new qe(n.childName,n.snapshotNode);return t.index_.compare(r,a)}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function X0(t,e){return{eventCache:t,serverCache:e}}function Nc(t,e,n,r){return X0(new ps(e,n,r),t.serverCache)}function qP(t,e,n,r){return X0(t.eventCache,new ps(e,n,r))}function Up(t){return t.eventCache.isFullyInitialized()?t.eventCache.getNode():null}function Eo(t){return t.serverCache.isFullyInitialized()?t.serverCache.getNode():null}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */let Fg;const x8=()=>(Fg||(Fg=new ba(s5)),Fg);class St{constructor(e,n=x8()){this.value=e,this.children=n}static fromObject(e){let n=new St(null);return cr(e,(r,a)=>{n=n.set(new vt(r),a)}),n}isEmpty(){return this.value===null&&this.children.isEmpty()}findRootMostMatchingPathAndValue(e,n){if(this.value!=null&&n(this.value))return{path:at(),value:this.value};if(We(e))return null;{const r=Je(e),a=this.children.get(r);if(a!==null){const i=a.findRootMostMatchingPathAndValue(_t(e),n);return i!=null?{path:nn(new vt(r),i.path),value:i.value}:null}else return null}}findRootMostValueAndPath(e){return this.findRootMostMatchingPathAndValue(e,()=>!0)}subtree(e){if(We(e))return this;{const n=Je(e),r=this.children.get(n);return r!==null?r.subtree(_t(e)):new St(null)}}set(e,n){if(We(e))return new St(n,this.children);{const r=Je(e),i=(this.children.get(r)||new St(null)).set(_t(e),n),s=this.children.insert(r,i);return new St(this.value,s)}}remove(e){if(We(e))return this.children.isEmpty()?new St(null):new St(null,this.children);{const n=Je(e),r=this.children.get(n);if(r){const a=r.remove(_t(e));let i;return a.isEmpty()?i=this.children.remove(n):i=this.children.insert(n,a),this.value===null&&i.isEmpty()?new St(null):new St(this.value,i)}else return this}}get(e){if(We(e))return this.value;{const n=Je(e),r=this.children.get(n);return r?r.get(_t(e)):null}}setTree(e,n){if(We(e))return n;{const r=Je(e),i=(this.children.get(r)||new St(null)).setTree(_t(e),n);let s;return i.isEmpty()?s=this.children.remove(r):s=this.children.insert(r,i),new St(this.value,s)}}fold(e){return this.fold_(at(),e)}fold_(e,n){const r={};return this.children.inorderTraversal((a,i)=>{r[a]=i.fold_(nn(e,a),n)}),n(e,this.value,r)}findOnPath(e,n){return this.findOnPath_(e,at(),n)}findOnPath_(e,n,r){const a=this.value?r(n,this.value):!1;if(a)return a;if(We(e))return null;{const i=Je(e),s=this.children.get(i);return s?s.findOnPath_(_t(e),nn(n,i),r):null}}foreachOnPath(e,n){return this.foreachOnPath_(e,at(),n)}foreachOnPath_(e,n,r){if(We(e))return this;{this.value&&r(n,this.value);const a=Je(e),i=this.children.get(a);return i?i.foreachOnPath_(_t(e),nn(n,a),r):new St(null)}}foreach(e){this.foreach_(at(),e)}foreach_(e,n){this.children.inorderTraversal((r,a)=>{a.foreach_(nn(e,r),n)}),this.value&&n(e,this.value)}foreachChild(e){this.children.inorderTraversal((n,r)=>{r.value&&e(n,r.value)})}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class sa{constructor(e){this.writeTree_=e}static empty(){return new sa(new St(null))}}function Oc(t,e,n){if(We(e))return new sa(new St(n));{const r=t.writeTree_.findRootMostValueAndPath(e);if(r!=null){const a=r.path;let i=r.value;const s=Kn(a,e);return i=i.updateChild(s,n),new sa(t.writeTree_.set(a,i))}else{const a=new St(n),i=t.writeTree_.setTree(e,a);return new sa(i)}}}function uT(t,e,n){let r=t;return cr(n,(a,i)=>{r=Oc(r,nn(e,a),i)}),r}function cT(t,e){if(We(e))return sa.empty();{const n=t.writeTree_.setTree(e,new St(null));return new sa(n)}}function P1(t,e){return Do(t,e)!=null}function Do(t,e){const n=t.writeTree_.findRootMostValueAndPath(e);return n!=null?t.writeTree_.get(n.path).getChild(Kn(n.path,e)):null}function dT(t){const e=[],n=t.writeTree_.value;return n!=null?n.isLeafNode()||n.forEachChild(kt,(r,a)=>{e.push(new qe(r,a))}):t.writeTree_.children.inorderTraversal((r,a)=>{a.value!=null&&e.push(new qe(r,a.value))}),e}function ss(t,e){if(We(e))return t;{const n=Do(t,e);return n!=null?new sa(new St(n)):new sa(t.writeTree_.subtree(e))}}function R1(t){return t.writeTree_.isEmpty()}function Xl(t,e){return GP(at(),t.writeTree_,e)}function GP(t,e,n){if(e.value!=null)return n.updateChild(t,e.value);{let r=null;return e.children.inorderTraversal((a,i)=>{a===".priority"?(ce(i.value!==null,"Priority writes must always be leaf nodes"),r=i.value):n=GP(nn(t,a),i,n)}),!n.getChild(t).isEmpty()&&r!==null&&(n=n.updateChild(nn(t,".priority"),r)),n}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function Q0(t,e){return KP(e,t)}function S8(t,e,n,r,a){ce(r>t.lastWriteId,"Stacking an older write on top of newer ones"),a===void 0&&(a=!0),t.allWrites.push({path:e,snap:n,writeId:r,visible:a}),a&&(t.visibleWrites=Oc(t.visibleWrites,e,n)),t.lastWriteId=r}function T8(t,e){for(let n=0;no.writeId===e);ce(n>=0,"removeWrite called with nonexistent writeId.");const r=t.allWrites[n];t.allWrites.splice(n,1);let a=r.visible,i=!1,s=t.allWrites.length-1;for(;a&&s>=0;){const o=t.allWrites[s];o.visible&&(s>=n&&C8(o,r.path)?a=!1:ta(r.path,o.path)&&(i=!0)),s--}if(a){if(i)return A8(t),!0;if(r.snap)t.visibleWrites=cT(t.visibleWrites,r.path);else{const o=r.children;cr(o,l=>{t.visibleWrites=cT(t.visibleWrites,nn(r.path,l))})}return!0}else return!1}function C8(t,e){if(t.snap)return ta(t.path,e);for(const n in t.children)if(t.children.hasOwnProperty(n)&&ta(nn(t.path,n),e))return!0;return!1}function A8(t){t.visibleWrites=HP(t.allWrites,I8,at()),t.allWrites.length>0?t.lastWriteId=t.allWrites[t.allWrites.length-1].writeId:t.lastWriteId=-1}function I8(t){return t.visible}function HP(t,e,n){let r=sa.empty();for(let a=0;a{r=r.updateImmediateChild(i,s)}),r;if(n){const i=ss(t.visibleWrites,e);return n.forEachChild(kt,(s,o)=>{const l=Xl(ss(i,new vt(s)),o);r=r.updateImmediateChild(s,l)}),dT(i).forEach(s=>{r=r.updateImmediateChild(s.name,s.node)}),r}else{const i=ss(t.visibleWrites,e);return dT(i).forEach(s=>{r=r.updateImmediateChild(s.name,s.node)}),r}}function R8(t,e,n,r,a){ce(r||a,"Either existingEventSnap or existingServerSnap must exist");const i=nn(e,n);if(P1(t.visibleWrites,i))return null;{const s=ss(t.visibleWrites,i);return R1(s)?a.getChild(n):Xl(s,a.getChild(n))}}function k8(t,e,n,r){const a=nn(e,n),i=Do(t.visibleWrites,a);if(i!=null)return i;if(r.isCompleteForChild(n)){const s=ss(t.visibleWrites,a);return Xl(s,r.getNode().getImmediateChild(n))}else return null}function N8(t,e){return Do(t.visibleWrites,e)}function O8(t,e,n,r,a,i,s){let o;const l=ss(t.visibleWrites,e),u=Do(l,at());if(u!=null)o=u;else if(n!=null)o=Xl(l,n);else return[];if(o=o.withIndex(s),!o.isEmpty()&&!o.isLeafNode()){const c=[],h=s.getCompare(),f=i?o.getReverseIteratorFrom(r,s):o.getIteratorFrom(r,s);let p=f.getNext();for(;p&&c.length0||!t.eventCache.isFullyInitialized()||a&&!r.getNode().equals(i)||!r.getNode().getPriority().equals(i.getPriority()))&&n.push(VP(Up(e)))}}function YP(t,e,n,r,a,i){const s=e.eventCache;if(jp(r,n)!=null)return e;{let o,l;if(We(n))if(ce(e.serverCache.isFullyInitialized(),"If change path is empty, we must have complete server data"),e.serverCache.isFiltered()){const u=Eo(e),c=u instanceof Oe?u:Oe.EMPTY_NODE,h=Wy(r,c);o=t.filter.updateFullNode(e.eventCache.getNode(),h,i)}else{const u=Vp(r,Eo(e));o=t.filter.updateFullNode(e.eventCache.getNode(),u,i)}else{const u=Je(n);if(u===".priority"){ce(fs(n)===1,"Can't have a priority with additional path components");const c=s.getNode();l=e.serverCache.getNode();const h=hT(r,n,c,l);h!=null?o=t.filter.updatePriority(c,h):o=s.getNode()}else{const c=_t(n);let h;if(s.isCompleteForChild(u)){l=e.serverCache.getNode();const f=hT(r,n,s.getNode(),l);f!=null?h=s.getNode().getImmediateChild(u).updateChild(c,f):h=s.getNode().getImmediateChild(u)}else h=$y(r,u,e.serverCache);h!=null?o=t.filter.updateChild(s.getNode(),u,h,c,a,i):o=s.getNode()}}return Nc(e,o,s.isFullyInitialized()||We(n),t.filter.filtersNodes())}}function zp(t,e,n,r,a,i,s,o){const l=e.serverCache;let u;const c=s?t.filter:t.filter.getIndexedFilter();if(We(n))u=c.updateFullNode(l.getNode(),r,null);else if(c.filtersNodes()&&!l.isFiltered()){const p=l.getNode().updateChild(n,r);u=c.updateFullNode(l.getNode(),p,null)}else{const p=Je(n);if(!l.isCompleteForPath(n)&&fs(n)>1)return e;const g=_t(n),_=l.getNode().getImmediateChild(p).updateChild(g,r);p===".priority"?u=c.updatePriority(l.getNode(),_):u=c.updateChild(l.getNode(),p,_,g,JP,null)}const h=qP(e,u,l.isFullyInitialized()||We(n),c.filtersNodes()),f=new Ky(a,h,i);return YP(t,h,n,a,f,o)}function k1(t,e,n,r,a,i,s){const o=e.eventCache;let l,u;const c=new Ky(a,e,i);if(We(n))u=t.filter.updateFullNode(e.eventCache.getNode(),r,s),l=Nc(e,u,!0,t.filter.filtersNodes());else{const h=Je(n);if(h===".priority")u=t.filter.updatePriority(e.eventCache.getNode(),r),l=Nc(e,u,o.isFullyInitialized(),o.isFiltered());else{const f=_t(n),p=o.getNode().getImmediateChild(h);let g;if(We(f))g=r;else{const m=c.getCompleteChild(h);m!=null?PP(f)===".priority"&&m.getChild(kP(f)).isEmpty()?g=m:g=m.updateChild(f,r):g=Oe.EMPTY_NODE}if(p.equals(g))l=e;else{const m=t.filter.updateChild(o.getNode(),h,g,f,c,s);l=Nc(e,m,o.isFullyInitialized(),t.filter.filtersNodes())}}}return l}function fT(t,e){return t.eventCache.isCompleteForChild(e)}function z8(t,e,n,r,a,i,s){let o=e;return r.foreach((l,u)=>{const c=nn(n,l);fT(e,Je(c))&&(o=k1(t,o,c,u,a,i,s))}),r.foreach((l,u)=>{const c=nn(n,l);fT(e,Je(c))||(o=k1(t,o,c,u,a,i,s))}),o}function pT(t,e,n){return n.foreach((r,a)=>{e=e.updateChild(r,a)}),e}function N1(t,e,n,r,a,i,s,o){if(e.serverCache.getNode().isEmpty()&&!e.serverCache.isFullyInitialized())return e;let l=e,u;We(n)?u=r:u=new St(null).setTree(n,r);const c=e.serverCache.getNode();return u.children.inorderTraversal((h,f)=>{if(c.hasChild(h)){const p=e.serverCache.getNode().getImmediateChild(h),g=pT(t,p,f);l=zp(t,l,new vt(h),g,a,i,s,o)}}),u.children.inorderTraversal((h,f)=>{const p=!e.serverCache.isCompleteForChild(h)&&f.value===null;if(!c.hasChild(h)&&!p){const g=e.serverCache.getNode().getImmediateChild(h),m=pT(t,g,f);l=zp(t,l,new vt(h),m,a,i,s,o)}}),l}function q8(t,e,n,r,a,i,s){if(jp(a,n)!=null)return e;const o=e.serverCache.isFiltered(),l=e.serverCache;if(r.value!=null){if(We(n)&&l.isFullyInitialized()||l.isCompleteForPath(n))return zp(t,e,n,l.getNode().getChild(n),a,i,o,s);if(We(n)){let u=new St(null);return l.getNode().forEachChild(no,(c,h)=>{u=u.set(new vt(c),h)}),N1(t,e,n,u,a,i,o,s)}else return e}else{let u=new St(null);return r.foreach((c,h)=>{const f=nn(n,c);l.isCompleteForPath(f)&&(u=u.set(c,l.getNode().getChild(f)))}),N1(t,e,n,u,a,i,o,s)}}function G8(t,e,n,r,a){const i=e.serverCache,s=qP(e,i.getNode(),i.isFullyInitialized()||We(n),i.isFiltered());return YP(t,s,n,r,JP,a)}function H8(t,e,n,r,a,i){let s;if(jp(r,n)!=null)return e;{const o=new Ky(r,e,a),l=e.eventCache.getNode();let u;if(We(n)||Je(n)===".priority"){let c;if(e.serverCache.isFullyInitialized())c=Vp(r,Eo(e));else{const h=e.serverCache.getNode();ce(h instanceof Oe,"serverChildren would be complete if leaf node"),c=Wy(r,h)}c=c,u=t.filter.updateFullNode(l,c,i)}else{const c=Je(n);let h=$y(r,c,e.serverCache);h==null&&e.serverCache.isCompleteForChild(c)&&(h=l.getImmediateChild(c)),h!=null?u=t.filter.updateChild(l,c,h,_t(n),o,i):e.eventCache.getNode().hasChild(c)?u=t.filter.updateChild(l,c,Oe.EMPTY_NODE,_t(n),o,i):u=l,u.isEmpty()&&e.serverCache.isFullyInitialized()&&(s=Vp(r,Eo(e)),s.isLeafNode()&&(u=t.filter.updateFullNode(u,s,i)))}return s=e.serverCache.isFullyInitialized()||jp(r,at())!=null,Nc(e,u,s,t.filter.filtersNodes())}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class W8{constructor(e,n){this.query_=e,this.eventRegistrations_=[];const r=this.query_._queryParams,a=new zy(r.getIndex()),i=l8(r);this.processor_=B8(i);const s=n.serverCache,o=n.eventCache,l=a.updateFullNode(Oe.EMPTY_NODE,s.getNode(),null),u=i.updateFullNode(Oe.EMPTY_NODE,o.getNode(),null),c=new ps(l,s.isFullyInitialized(),a.filtersNodes()),h=new ps(u,o.isFullyInitialized(),i.filtersNodes());this.viewCache_=X0(h,c),this.eventGenerator_=new _8(this.query_)}get query(){return this.query_}}function $8(t){return t.viewCache_.serverCache.getNode()}function K8(t){return Up(t.viewCache_)}function J8(t,e){const n=Eo(t.viewCache_);return n&&(t.query._queryParams.loadsAllData()||!We(e)&&!n.getImmediateChild(Je(e)).isEmpty())?n.getChild(e):null}function mT(t){return t.eventRegistrations_.length===0}function Y8(t,e){t.eventRegistrations_.push(e)}function gT(t,e,n){const r=[];if(n){ce(e==null,"A cancel should cancel all event registrations.");const a=t.query._path;t.eventRegistrations_.forEach(i=>{const s=i.createCancelEvent(n,a);s&&r.push(s)})}if(e){let a=[];for(let i=0;i{r.push(Yl(i,s))}),n.isFullyInitialized()&&r.push(VP(n.getNode())),XP(t,r,n.getNode(),e)}function XP(t,e,n,r){const a=r?[r]:t.eventRegistrations_;return y8(t.eventGenerator_,e,n,a)}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */let qp;class QP{constructor(){this.views=new Map}}function Q8(t){ce(!qp,"__referenceConstructor has already been defined"),qp=t}function Z8(){return ce(qp,"Reference.ts has not been loaded"),qp}function eB(t){return t.views.size===0}function Jy(t,e,n,r){const a=e.source.queryId;if(a!==null){const i=t.views.get(a);return ce(i!=null,"SyncTree gave us an op for an invalid query."),vT(i,e,n,r)}else{let i=[];for(const s of t.views.values())i=i.concat(vT(s,e,n,r));return i}}function ZP(t,e,n,r,a){const i=e._queryIdentifier,s=t.views.get(i);if(!s){let o=Vp(n,a?r:null),l=!1;o?l=!0:r instanceof Oe?(o=Wy(n,r),l=!1):(o=Oe.EMPTY_NODE,l=!1);const u=X0(new ps(o,l,!1),new ps(r,a,!1));return new W8(e,u)}return s}function tB(t,e,n,r,a,i){const s=ZP(t,e,r,a,i);return t.views.has(e._queryIdentifier)||t.views.set(e._queryIdentifier,s),Y8(s,n),X8(s,n)}function nB(t,e,n,r){const a=e._queryIdentifier,i=[];let s=[];const o=ms(t);if(a==="default")for(const[l,u]of t.views.entries())s=s.concat(gT(u,n,r)),mT(u)&&(t.views.delete(l),u.query._queryParams.loadsAllData()||i.push(u.query));else{const l=t.views.get(a);l&&(s=s.concat(gT(l,n,r)),mT(l)&&(t.views.delete(a),l.query._queryParams.loadsAllData()||i.push(l.query)))}return o&&!ms(t)&&i.push(new(Z8())(e._repo,e._path)),{removed:i,events:s}}function eR(t){const e=[];for(const n of t.views.values())n.query._queryParams.loadsAllData()||e.push(n);return e}function os(t,e){let n=null;for(const r of t.views.values())n=n||J8(r,e);return n}function tR(t,e){if(e._queryParams.loadsAllData())return Z0(t);{const r=e._queryIdentifier;return t.views.get(r)}}function nR(t,e){return tR(t,e)!=null}function ms(t){return Z0(t)!=null}function Z0(t){for(const e of t.views.values())if(e.query._queryParams.loadsAllData())return e;return null}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */let Gp;function rB(t){ce(!Gp,"__referenceConstructor has already been defined"),Gp=t}function aB(){return ce(Gp,"Reference.ts has not been loaded"),Gp}let iB=1;class _T{constructor(e){this.listenProvider_=e,this.syncPointTree_=new St(null),this.pendingWriteTree_=M8(),this.tagToQueryMap=new Map,this.queryToTagMap=new Map}}function rR(t,e,n,r,a){return S8(t.pendingWriteTree_,e,n,r,a),a?ih(t,new yo(zP(),e,n)):[]}function Xs(t,e,n=!1){const r=T8(t.pendingWriteTree_,e);if(w8(t.pendingWriteTree_,e)){let i=new St(null);return r.snap!=null?i=i.set(at(),!0):cr(r.children,s=>{i=i.set(new vt(s),!0)}),ih(t,new Bp(r.path,i,n))}else return[]}function ah(t,e,n){return ih(t,new yo(Gy(),e,n))}function sB(t,e,n){const r=St.fromObject(n);return ih(t,new bd(Gy(),e,r))}function oB(t,e){return ih(t,new Ed(Gy(),e))}function lB(t,e,n){const r=Xy(t,n);if(r){const a=Qy(r),i=a.path,s=a.queryId,o=Kn(i,e),l=new Ed(Hy(s),o);return Zy(t,i,l)}else return[]}function aR(t,e,n,r,a=!1){const i=e._path,s=t.syncPointTree_.get(i);let o=[];if(s&&(e._queryIdentifier==="default"||nR(s,e))){const l=nB(s,e,n,r);eB(s)&&(t.syncPointTree_=t.syncPointTree_.remove(i));const u=l.removed;if(o=l.events,!a){const c=u.findIndex(f=>f._queryParams.loadsAllData())!==-1,h=t.syncPointTree_.findOnPath(i,(f,p)=>ms(p));if(c&&!h){const f=t.syncPointTree_.subtree(i);if(!f.isEmpty()){const p=hB(f);for(let g=0;g0&&!r&&(c?t.listenProvider_.stopListening(Mc(e),null):u.forEach(f=>{const p=t.queryToTagMap.get(em(f));t.listenProvider_.stopListening(Mc(f),p)}))}fB(t,u)}return o}function iR(t,e,n,r){const a=Xy(t,r);if(a!=null){const i=Qy(a),s=i.path,o=i.queryId,l=Kn(s,e),u=new yo(Hy(o),l,n);return Zy(t,s,u)}else return[]}function uB(t,e,n,r){const a=Xy(t,r);if(a){const i=Qy(a),s=i.path,o=i.queryId,l=Kn(s,e),u=St.fromObject(n),c=new bd(Hy(o),l,u);return Zy(t,s,c)}else return[]}function cB(t,e,n,r=!1){const a=e._path;let i=null,s=!1;t.syncPointTree_.foreachOnPath(a,(f,p)=>{const g=Kn(f,a);i=i||os(p,g),s=s||ms(p)});let o=t.syncPointTree_.get(a);o?(s=s||ms(o),i=i||os(o,at())):(o=new QP,t.syncPointTree_=t.syncPointTree_.set(a,o));let l;i!=null?l=!0:(l=!1,i=Oe.EMPTY_NODE,t.syncPointTree_.subtree(a).foreachChild((p,g)=>{const m=os(g,at());m&&(i=i.updateImmediateChild(p,m))}));const u=nR(o,e);if(!u&&!e._queryParams.loadsAllData()){const f=em(e);ce(!t.queryToTagMap.has(f),"View does not exist, but we have a tag");const p=pB();t.queryToTagMap.set(f,p),t.tagToQueryMap.set(p,f)}const c=Q0(t.pendingWriteTree_,a);let h=tB(o,e,n,c,i,l);if(!u&&!s&&!r){const f=tR(o,e);h=h.concat(mB(t,e,f))}return h}function Yy(t,e,n){const a=t.pendingWriteTree_,i=t.syncPointTree_.findOnPath(e,(s,o)=>{const l=Kn(s,e),u=os(o,l);if(u)return u});return WP(a,e,i,n,!0)}function dB(t,e){const n=e._path;let r=null;t.syncPointTree_.foreachOnPath(n,(u,c)=>{const h=Kn(u,n);r=r||os(c,h)});let a=t.syncPointTree_.get(n);a?r=r||os(a,at()):(a=new QP,t.syncPointTree_=t.syncPointTree_.set(n,a));const i=r!=null,s=i?new ps(r,!0,!1):null,o=Q0(t.pendingWriteTree_,e._path),l=ZP(a,e,o,i?s.getNode():Oe.EMPTY_NODE,i);return K8(l)}function ih(t,e){return sR(e,t.syncPointTree_,null,Q0(t.pendingWriteTree_,at()))}function sR(t,e,n,r){if(We(t.path))return oR(t,e,n,r);{const a=e.get(at());n==null&&a!=null&&(n=os(a,at()));let i=[];const s=Je(t.path),o=t.operationForChild(s),l=e.children.get(s);if(l&&o){const u=n?n.getImmediateChild(s):null,c=$P(r,s);i=i.concat(sR(o,l,u,c))}return a&&(i=i.concat(Jy(a,t,r,n))),i}}function oR(t,e,n,r){const a=e.get(at());n==null&&a!=null&&(n=os(a,at()));let i=[];return e.children.inorderTraversal((s,o)=>{const l=n?n.getImmediateChild(s):null,u=$P(r,s),c=t.operationForChild(s);c&&(i=i.concat(oR(c,o,l,u)))}),a&&(i=i.concat(Jy(a,t,r,n))),i}function lR(t,e){const n=e.query,r=xd(t,n);return{hashFn:()=>($8(e)||Oe.EMPTY_NODE).hash(),onComplete:a=>{if(a==="ok")return r?lB(t,n._path,r):oB(t,n._path);{const i=u5(a,n);return aR(t,n,null,i)}}}}function xd(t,e){const n=em(e);return t.queryToTagMap.get(n)}function em(t){return t._path.toString()+"$"+t._queryIdentifier}function Xy(t,e){return t.tagToQueryMap.get(e)}function Qy(t){const e=t.indexOf("$");return ce(e!==-1&&e{if(n&&ms(n))return[Z0(n)];{let a=[];return n&&(a=eR(n)),cr(r,(i,s)=>{a=a.concat(s)}),a}})}function Mc(t){return t._queryParams.loadsAllData()&&!t._queryParams.isDefault()?new(aB())(t._repo,t._path):t}function fB(t,e){for(let n=0;n{if(!We(u)&&c&&ms(c))return[Z0(c).query];{let f=[];return c&&(f=f.concat(eR(c).map(p=>p.query))),cr(h,(p,g)=>{f=f.concat(g)}),f}});for(let u=0;u{const u=nE(l,e.getImmediateChild(o),n);u!==l&&(i=i.updateImmediateChild(o,u))}),i}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class rE{constructor(e="",n=null,r={children:{},childCount:0}){this.name=e,this.parent=n,this.node=r}}function aE(t,e){let n=e instanceof vt?e:new vt(e),r=t,a=Je(n);for(;a!==null;){const i=Jl(r.node.children,a)||{children:{},childCount:0};r=new rE(a,r,i),n=_t(n),a=Je(n)}return r}function _u(t){return t.node.value}function cR(t,e){t.node.value=e,O1(t)}function dR(t){return t.node.childCount>0}function EB(t){return _u(t)===void 0&&!dR(t)}function tm(t,e){cr(t.node.children,(n,r)=>{e(new rE(n,t,r))})}function hR(t,e,n,r){n&&!r&&e(t),tm(t,a=>{hR(a,e,!0,r)}),n&&r&&e(t)}function bB(t,e,n){let r=t.parent;for(;r!==null;){if(e(r))return!0;r=r.parent}return!1}function sh(t){return new vt(t.parent===null?t.name:sh(t.parent)+"/"+t.name)}function O1(t){t.parent!==null&&xB(t.parent,t.name,t)}function xB(t,e,n){const r=EB(n),a=La(t.node.children,e);r&&a?(delete t.node.children[e],t.node.childCount--,O1(t)):!r&&!a&&(t.node.children[e]=n.node,t.node.childCount++,O1(t))}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const SB=/[\[\].#$\/\u0000-\u001F\u007F]/,TB=/[\[\].#$\u0000-\u001F\u007F]/,Bg=10*1024*1024,fR=function(t){return typeof t=="string"&&t.length!==0&&!SB.test(t)},pR=function(t){return typeof t=="string"&&t.length!==0&&!TB.test(t)},wB=function(t){return t&&(t=t.replace(/^\/*\.info(\/|$)/,"/")),pR(t)},ET=function(t){return t===null||typeof t=="string"||typeof t=="number"&&!My(t)||t&&typeof t=="object"&&La(t,".sv")},oh=function(t,e,n,r){r&&e===void 0||iE(Ry(t,"value"),e,n)},iE=function(t,e,n){const r=n instanceof vt?new z5(n,t):n;if(e===void 0)throw new Error(t+"contains undefined "+qs(r));if(typeof e=="function")throw new Error(t+"contains a function "+qs(r)+" with contents = "+e.toString());if(My(e))throw new Error(t+"contains "+e.toString()+" "+qs(r));if(typeof e=="string"&&e.length>Bg/3&&$0(e)>Bg)throw new Error(t+"contains a string greater than "+Bg+" utf8 bytes "+qs(r)+" ('"+e.substring(0,50)+"...')");if(e&&typeof e=="object"){let a=!1,i=!1;if(cr(e,(s,o)=>{if(s===".value")a=!0;else if(s!==".priority"&&s!==".sv"&&(i=!0,!fR(s)))throw new Error(t+" contains an invalid key ("+s+") "+qs(r)+`. Keys must be non-empty strings and can't contain ".", "#", "$", "/", "[", or "]"`);q5(r,s),iE(t,o,r),G5(r)}),a&&i)throw new Error(t+' contains ".value" child '+qs(r)+" in addition to actual children.")}},mR=function(t,e,n,r){if(!pR(n))throw new Error(Ry(t,e)+'was an invalid path = "'+n+`". Paths must be non-empty strings and can't contain ".", "#", "$", "[", or "]"`)},CB=function(t,e,n,r){n&&(n=n.replace(/^\/*\.info(\/|$)/,"/")),mR(t,e,n)},sE=function(t,e){if(Je(e)===".info")throw new Error(t+" failed = Can't modify data under /.info/")},AB=function(t,e){const n=e.path.toString();if(typeof e.repoInfo.host!="string"||e.repoInfo.host.length===0||!fR(e.repoInfo.namespace)&&e.repoInfo.host.split(":")[0]!=="localhost"||n.length!==0&&!wB(n))throw new Error(Ry(t,"url")+`must be a valid firebase URL and the path can't contain ".", "#", "$", "[", or "]".`)};/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class IB{constructor(){this.eventLists_=[],this.recursionDepth_=0}}function gR(t,e){let n=null;for(let r=0;rta(r,e)||ta(e,r))}function PB(t,e){t.recursionDepth_++;let n=!0;for(let r=0;r{bT(t,r,a,i,s)},t.authTokenProvider_,t.appCheckProvider_),setTimeout(()=>xT(t,!0),0);else{if(typeof n<"u"&&n!==null){if(typeof n!="object")throw new Error("Only objects are supported for option databaseAuthVariableOverride");try{tn(n)}catch(r){throw new Error("Invalid authOverride provided: "+r)}}t.persistentConnection_=new Za(t.repoInfo_,e,(r,a,i,s)=>{bT(t,r,a,i,s)},r=>{xT(t,r)},r=>{LB(t,r)},t.authTokenProvider_,t.appCheckProvider_,n),t.server_=t.persistentConnection_}t.authTokenProvider_.addTokenChangeListener(r=>{t.server_.refreshAuthToken(r)}),t.appCheckProvider_.addTokenChangeListener(r=>{t.server_.refreshAppCheckToken(r.token)}),t.statsReporter_=_5(t.repoInfo_,()=>new v8(t.stats_,t.server_)),t.infoData_=new h8,t.infoSyncTree_=new _T({startListening:(r,a,i,s)=>{let o=[];const l=t.infoData_.getNode(r._path);return l.isEmpty()||(o=ah(t.infoSyncTree_,r._path,l),setTimeout(()=>{s("ok")},0)),o},stopListening:()=>{}}),lE(t,"connected",!1),t.serverSyncTree_=new _T({startListening:(r,a,i,s)=>(t.server_.listen(r,i,a,(o,l)=>{const u=s(o,l);Ra(t.eventQueue_,r._path,u)}),[]),stopListening:(r,a)=>{t.server_.unlisten(r,a)}})}function vR(t){const n=t.infoData_.getNode(new vt(".info/serverTimeOffset")).val()||0;return new Date().getTime()+n}function oE(t){return gB({timestamp:vR(t)})}function bT(t,e,n,r,a){t.dataUpdateCount++;const i=new vt(e);n=t.interceptServerDataCallback_?t.interceptServerDataCallback_(e,n):n;let s=[];if(a)if(r){const l=Rp(n,u=>un(u));s=uB(t.serverSyncTree_,i,l,a)}else{const l=un(n);s=iR(t.serverSyncTree_,i,l,a)}else if(r){const l=Rp(n,u=>un(u));s=sB(t.serverSyncTree_,i,l)}else{const l=un(n);s=ah(t.serverSyncTree_,i,l)}let o=i;s.length>0&&(o=rm(t,i)),Ra(t.eventQueue_,o,s)}function xT(t,e){lE(t,"connected",e),e===!1&&BB(t)}function LB(t,e){cr(e,(n,r)=>{lE(t,n,r)})}function lE(t,e,n){const r=new vt("/.info/"+e),a=un(n);t.infoData_.updateSnapshot(r,a);const i=ah(t.infoSyncTree_,r,a);Ra(t.eventQueue_,r,i)}function _R(t){return t.nextWriteId_++}function DB(t,e,n){const r=dB(t.serverSyncTree_,e);return r!=null?Promise.resolve(r):t.server_.get(e).then(a=>{const i=un(a).withIndex(e._queryParams.getIndex());cB(t.serverSyncTree_,e,n,!0);let s;if(e._queryParams.loadsAllData())s=ah(t.serverSyncTree_,e._path,i);else{const o=xd(t.serverSyncTree_,e);s=iR(t.serverSyncTree_,e._path,i,o)}return Ra(t.eventQueue_,e._path,s),aR(t.serverSyncTree_,e,n,null,!0),i},a=>(nm(t,"get for query "+tn(e)+" failed: "+a),Promise.reject(new Error(a))))}function FB(t,e,n,r,a){nm(t,"set",{path:e.toString(),value:n,priority:r});const i=oE(t),s=un(n,r),o=Yy(t.serverSyncTree_,e),l=uR(s,o,i),u=_R(t),c=rR(t.serverSyncTree_,e,l,u,!0);gR(t.eventQueue_,c),t.server_.put(e.toString(),s.val(!0),(f,p)=>{const g=f==="ok";g||sr("set at "+e+" failed: "+f);const m=Xs(t.serverSyncTree_,u,!g);Ra(t.eventQueue_,e,m),VB(t,a,f,p)});const h=SR(t,e);rm(t,h),Ra(t.eventQueue_,h,[])}function BB(t){nm(t,"onDisconnectEvents");const e=oE(t),n=Fp();I1(t.onDisconnect_,at(),(a,i)=>{const s=yB(a,i,t.serverSyncTree_,e);jP(n,a,s)});let r=[];I1(n,at(),(a,i)=>{r=r.concat(ah(t.serverSyncTree_,a,i));const s=SR(t,a);rm(t,s)}),t.onDisconnect_=Fp(),Ra(t.eventQueue_,at(),r)}function UB(t){t.persistentConnection_&&t.persistentConnection_.interrupt(kB)}function nm(t,...e){let n="";t.persistentConnection_&&(n=t.persistentConnection_.id+":"),Fn(n,...e)}function VB(t,e,n,r){e&&vu(()=>{if(n==="ok")e(null);else{const a=(n||"error").toUpperCase();let i=a;r&&(i+=": "+r);const s=new Error(i);s.code=a,e(s)}})}function yR(t,e,n){return Yy(t.serverSyncTree_,e,n)||Oe.EMPTY_NODE}function uE(t,e=t.transactionQueueTree_){if(e||am(t,e),_u(e)){const n=bR(t,e);ce(n.length>0,"Sending zero length transaction queue"),n.every(a=>a.status===0)&&jB(t,sh(e),n)}else dR(e)&&tm(e,n=>{uE(t,n)})}function jB(t,e,n){const r=n.map(u=>u.currentWriteId),a=yR(t,e,r);let i=a;const s=a.hash();for(let u=0;u{nm(t,"transaction put response",{path:l.toString(),status:u});let c=[];if(u==="ok"){const h=[];for(let f=0;fn[f].onComplete(null,!0,n[f].currentOutputSnapshotResolved)),n[f].unwatcher();am(t,aE(t.transactionQueueTree_,e)),uE(t,t.transactionQueueTree_),Ra(t.eventQueue_,e,c);for(let f=0;fo.status===0).map(o=>o.currentWriteId);for(let o=0;o=NB)c=!0,h="maxretry",a=a.concat(Xs(t.serverSyncTree_,l.currentWriteId,!0));else{const f=yR(t,l.path,s);l.currentInputSnapshot=f;const p=e[o].update(f.val());if(p!==void 0){iE("transaction failed: Data returned ",p,l.path);let g=un(p);typeof p=="object"&&p!=null&&La(p,".priority")||(g=g.updatePriority(f.getPriority()));const _=l.currentWriteId,x=oE(t),E=uR(g,f,x);l.currentOutputSnapshotRaw=g,l.currentOutputSnapshotResolved=E,l.currentWriteId=_R(t),s.splice(s.indexOf(_),1),a=a.concat(rR(t.serverSyncTree_,l.path,E,l.currentWriteId,l.applyLocally)),a=a.concat(Xs(t.serverSyncTree_,_,!0))}else c=!0,h="nodata",a=a.concat(Xs(t.serverSyncTree_,l.currentWriteId,!0))}Ra(t.eventQueue_,n,a),a=[],c&&(e[o].status=2,function(f){setTimeout(f,Math.floor(0))}(e[o].unwatcher),e[o].onComplete&&(h==="nodata"?r.push(()=>e[o].onComplete(null,!1,e[o].currentInputSnapshot)):r.push(()=>e[o].onComplete(new Error(h),!1,null))))}am(t,t.transactionQueueTree_);for(let o=0;or.order-a.order),n}function xR(t,e,n){const r=_u(e);if(r)for(let a=0;a{xR(t,a,n)})}function am(t,e){const n=_u(e);if(n){let r=0;for(let a=0;a0?n:void 0)}tm(e,r=>{am(t,r)})}function SR(t,e){const n=sh(ER(t,e)),r=aE(t.transactionQueueTree_,e);return bB(r,a=>{Ug(t,a)}),Ug(t,r),hR(r,a=>{Ug(t,a)}),n}function Ug(t,e){const n=_u(e);if(n){const r=[];let a=[],i=-1;for(let s=0;s0){let a=n[r];try{a=decodeURIComponent(a.replace(/\+/g," "))}catch{}e+="/"+a}return e}function GB(t){const e={};t.charAt(0)==="?"&&(t=t.substring(1));for(const n of t.split("&")){if(n.length===0)continue;const r=n.split("=");r.length===2?e[decodeURIComponent(r[0])]=decodeURIComponent(r[1]):sr(`Invalid query segment '${n}' in query '${t}'`)}return e}const ST=function(t,e){const n=HB(t),r=n.namespace;n.domain==="firebase.com"&&ui(n.host+" is no longer supported. Please use .firebaseio.com instead"),(!r||r==="undefined")&&n.domain!=="localhost"&&ui("Cannot parse Firebase url. Please use https://.firebaseio.com"),n.secure||a5();const a=n.scheme==="ws"||n.scheme==="wss";return{repoInfo:new EP(n.host,n.secure,r,a,e,"",r!==n.subdomain),path:new vt(n.pathString)}},HB=function(t){let e="",n="",r="",a="",i="",s=!0,o="https",l=443;if(typeof t=="string"){let u=t.indexOf("//");u>=0&&(o=t.substring(0,u-1),t=t.substring(u+2));let c=t.indexOf("/");c===-1&&(c=t.length);let h=t.indexOf("?");h===-1&&(h=t.length),e=t.substring(0,Math.min(c,h)),c=0?(s=o==="https"||o==="wss",l=parseInt(e.substring(u+1),10)):u=e.length;const p=e.slice(0,u);if(p.toLowerCase()==="localhost")n="localhost";else if(p.split(".").length<=2)n=p;else{const g=e.indexOf(".");r=e.substring(0,g).toLowerCase(),n=e.substring(g+1),i=r}"ns"in f&&(i=f.ns)}return{host:e,port:l,domain:n,subdomain:r,secure:s,scheme:o,pathString:a,namespace:i}};/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const TT="-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz",WB=function(){let t=0;const e=[];return function(n){const r=n===t;t=n;let a;const i=new Array(8);for(a=7;a>=0;a--)i[a]=TT.charAt(n%64),n=Math.floor(n/64);ce(n===0,"Cannot push at time == 0");let s=i.join("");if(r){for(a=11;a>=0&&e[a]===63;a--)e[a]=0;e[a]++}else for(a=0;a<12;a++)e[a]=Math.floor(Math.random()*64);for(a=0;a<12;a++)s+=TT.charAt(e[a]);return ce(s.length===20,"nextPushId: Length should be 20."),s}}();/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class $B{constructor(e,n,r,a){this.eventType=e,this.eventRegistration=n,this.snapshot=r,this.prevName=a}getPath(){const e=this.snapshot.ref;return this.eventType==="value"?e._path:e.parent._path}getEventType(){return this.eventType}getEventRunner(){return this.eventRegistration.getEventRunner(this)}toString(){return this.getPath().toString()+":"+this.eventType+":"+tn(this.snapshot.exportVal())}}class KB{constructor(e,n,r){this.eventRegistration=e,this.error=n,this.path=r}getPath(){return this.path}getEventType(){return"cancel"}getEventRunner(){return this.eventRegistration.getEventRunner(this)}toString(){return this.path.toString()+":cancel"}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class JB{constructor(e,n){this.snapshotCallback=e,this.cancelCallback=n}onValue(e,n){this.snapshotCallback.call(null,e,n)}onCancel(e){return ce(this.hasCancelCallback,"Raising a cancel event on a listener with no cancel callback"),this.cancelCallback.call(null,e)}get hasCancelCallback(){return!!this.cancelCallback}matches(e){return this.snapshotCallback===e.snapshotCallback||this.snapshotCallback.userCallback!==void 0&&this.snapshotCallback.userCallback===e.snapshotCallback.userCallback&&this.snapshotCallback.context===e.snapshotCallback.context}}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class yu{constructor(e,n,r,a){this._repo=e,this._path=n,this._queryParams=r,this._orderByCalled=a}get key(){return We(this._path)?null:PP(this._path)}get ref(){return new _i(this._repo,this._path)}get _queryIdentifier(){const e=oT(this._queryParams),n=Ly(e);return n==="{}"?"default":n}get _queryObject(){return oT(this._queryParams)}isEqual(e){if(e=pn(e),!(e instanceof yu))return!1;const n=this._repo===e._repo,r=NP(this._path,e._path),a=this._queryIdentifier===e._queryIdentifier;return n&&r&&a}toJSON(){return this.toString()}toString(){return this._repo.toString()+j5(this._path)}}function YB(t,e){if(t._orderByCalled===!0)throw new Error(e+": You can't combine multiple orderBy calls.")}function cE(t){let e=null,n=null;if(t.hasStart()&&(e=t.getIndexStartValue()),t.hasEnd()&&(n=t.getIndexEndValue()),t.getIndex()===no){const r="Query: When ordering by key, you may only pass one argument to startAt(), endAt(), or equalTo().",a="Query: When ordering by key, the argument passed to startAt(), startAfter(), endAt(), endBefore(), or equalTo() must be a string.";if(t.hasStart()){if(t.getIndexStartName()!==_o)throw new Error(r);if(typeof e!="string")throw new Error(a)}if(t.hasEnd()){if(t.getIndexEndName()!==hs)throw new Error(r);if(typeof n!="string")throw new Error(a)}}else if(t.getIndex()===kt){if(e!=null&&!ET(e)||n!=null&&!ET(n))throw new Error("Query: When ordering by priority, the first argument passed to startAt(), startAfter() endAt(), endBefore(), or equalTo() must be a valid priority value (null, a number, or a string).")}else if(ce(t.getIndex()instanceof UP||t.getIndex()===jy,"unknown index type."),e!=null&&typeof e=="object"||n!=null&&typeof n=="object")throw new Error("Query: First argument passed to startAt(), startAfter(), endAt(), endBefore(), or equalTo() cannot be an object.")}function TR(t){if(t.hasStart()&&t.hasEnd()&&t.hasLimit()&&!t.hasAnchoredLimit())throw new Error("Query: Can't combine startAt(), startAfter(), endAt(), endBefore(), and limit(). Use limitToFirst() or limitToLast() instead.")}class _i extends yu{constructor(e,n){super(e,n,new qy,!1)}get parent(){const e=kP(this._path);return e===null?null:new _i(this._repo,e)}get root(){let e=this;for(;e.parent!==null;)e=e.parent;return e}}class Sd{constructor(e,n,r){this._node=e,this.ref=n,this._index=r}get priority(){return this._node.getPriority().val()}get key(){return this.ref.key}get size(){return this._node.numChildren()}child(e){const n=new vt(e),r=Td(this.ref,e);return new Sd(this._node.getChild(n),r,kt)}exists(){return!this._node.isEmpty()}exportVal(){return this._node.val(!0)}forEach(e){return this._node.isLeafNode()?!1:!!this._node.forEachChild(this._index,(r,a)=>e(new Sd(a,Td(this.ref,r),kt)))}hasChild(e){const n=new vt(e);return!this._node.getChild(n).isEmpty()}hasChildren(){return this._node.isLeafNode()?!1:!this._node.isEmpty()}toJSON(){return this.exportVal()}val(){return this._node.val()}}function Ql(t,e){return t=pn(t),t._checkNotDeleted("ref"),e!==void 0?Td(t._root,e):t._root}function Td(t,e){return t=pn(t),Je(t._path)===null?CB("child","path",e):mR("child","path",e),new _i(t._repo,nn(t._path,e))}function wR(t,e){t=pn(t),sE("push",t._path),oh("push",e,t._path,!0);const n=vR(t._repo),r=WB(n),a=Td(t,r),i=Td(t,r);let s;return e!=null?s=CR(i,e).then(()=>i):s=Promise.resolve(i),a.then=s.then.bind(s),a.catch=s.then.bind(s,void 0),a}function XB(t){return sE("remove",t._path),CR(t,null)}function CR(t,e){t=pn(t),sE("set",t._path),oh("set",e,t._path,!1);const n=new W0;return FB(t._repo,t._path,e,null,n.wrapCallback(()=>{})),n.promise}function dE(t){t=pn(t);const e=new JB(()=>{}),n=new hE(e);return DB(t._repo,t,n).then(r=>new Sd(r,new _i(t._repo,t._path),t._queryParams.getIndex()))}class hE{constructor(e){this.callbackContext=e}respondsTo(e){return e==="value"}createEvent(e,n){const r=n._queryParams.getIndex();return new $B("value",this,new Sd(e.snapshotNode,new _i(n._repo,n._path),r))}getEventRunner(e){return e.getEventType()==="cancel"?()=>this.callbackContext.onCancel(e.error):()=>this.callbackContext.onValue(e.snapshot,null)}createCancelEvent(e,n){return this.callbackContext.hasCancelCallback?new KB(this,e,n):null}matches(e){return e instanceof hE?!e.callbackContext||!this.callbackContext?!0:e.callbackContext.matches(this.callbackContext):!1}hasAnyCallback(){return this.callbackContext!==null}}class im{}class QB extends im{constructor(e,n){super(),this._value=e,this._key=n,this.type="endAt"}_apply(e){oh("endAt",this._value,e._path,!0);const n=c8(e._queryParams,this._value,this._key);if(TR(n),cE(n),e._queryParams.hasEnd())throw new Error("endAt: Starting point was already set (by another call to endAt, endBefore or equalTo).");return new yu(e._repo,e._path,n,e._orderByCalled)}}class ZB extends im{constructor(e,n){super(),this._value=e,this._key=n,this.type="startAt"}_apply(e){oh("startAt",this._value,e._path,!0);const n=u8(e._queryParams,this._value,this._key);if(TR(n),cE(n),e._queryParams.hasStart())throw new Error("startAt: Starting point was already set (by another call to startAt, startBefore or equalTo).");return new yu(e._repo,e._path,n,e._orderByCalled)}}class e9 extends im{constructor(){super(...arguments),this.type="orderByValue"}_apply(e){YB(e,"orderByValue");const n=d8(e._queryParams,jy);return cE(n),new yu(e._repo,e._path,n,!0)}}function fE(){return new e9}class t9 extends im{constructor(e,n){super(),this._value=e,this._key=n,this.type="equalTo"}_apply(e){if(oh("equalTo",this._value,e._path,!1),e._queryParams.hasStart())throw new Error("equalTo: Starting point was already set (by another call to startAt/startAfter or equalTo).");if(e._queryParams.hasEnd())throw new Error("equalTo: Ending point was already set (by another call to endAt/endBefore or equalTo).");return new QB(this._value,this._key)._apply(new ZB(this._value,this._key)._apply(e))}}function pE(t,e){return new t9(t,e)}function mE(t,...e){let n=pn(t);for(const r of e)n=r._apply(n);return n}Q8(_i);rB(_i);/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const n9="FIREBASE_DATABASE_EMULATOR_HOST",M1={};let r9=!1;function a9(t,e,n,r){t.repoInfo_=new EP(`${e}:${n}`,!1,t.repoInfo_.namespace,t.repoInfo_.webSocketOnly,t.repoInfo_.nodeAdmin,t.repoInfo_.persistenceKey,t.repoInfo_.includeNamespaceInQueryParams,!0),r&&(t.authTokenProvider_=r)}function i9(t,e,n,r,a){let i=r||t.options.databaseURL;i===void 0&&(t.options.projectId||ui("Can't determine Firebase Database URL. Be sure to include a Project ID when calling firebase.initializeApp()."),Fn("Using default host for project ",t.options.projectId),i=`${t.options.projectId}-default-rtdb.firebaseio.com`);let s=ST(i,a),o=s.repoInfo,l;typeof process<"u"&&qS&&(l=qS[n9]),l?(i=`http://${l}?ns=${o.namespace}`,s=ST(i,a),o=s.repoInfo):s.repoInfo.secure;const u=new m5(t.name,t.options,e);AB("Invalid Firebase Database URL",s),We(s.path)||ui("Database URL must point to the root of a Firebase Database (not including a child path).");const c=o9(o,t,u,new p5(t.name,n));return new l9(c,t)}function s9(t,e){const n=M1[e];(!n||n[t.key]!==t)&&ui(`Database ${e}(${t.repoInfo_}) has already been deleted.`),UB(t),delete n[t.key]}function o9(t,e,n,r){let a=M1[e.name];a||(a={},M1[e.name]=a);let i=a[t.toURLString()];return i&&ui("Database initialized multiple times. Please make sure the format of the database URL matches with each database() call."),i=new OB(t,r9,n,r),a[t.toURLString()]=i,i}class l9{constructor(e,n){this._repoInternal=e,this.app=n,this.type="database",this._instanceStarted=!1}get _repo(){return this._instanceStarted||(MB(this._repoInternal,this.app.options.appId,this.app.options.databaseAuthVariableOverride),this._instanceStarted=!0),this._repoInternal}get _root(){return this._rootInternal||(this._rootInternal=new _i(this._repo,at())),this._rootInternal}_delete(){return this._rootInternal!==null&&(s9(this._repo,this.app.name),this._repoInternal=null,this._rootInternal=null),Promise.resolve()}_checkNotDeleted(e){this._rootInternal===null&&ui("Cannot call "+e+" on a deleted database.")}}function u9(t=Oy(),e){const n=J0(t,"database").getImmediate({identifier:e});if(!n._instanceStarted){const r=JI("database");r&&c9(n,...r)}return n}function c9(t,e,n,r={}){t=pn(t),t._checkNotDeleted("useEmulator"),t._instanceStarted&&ui("Cannot call useEmulator() after instance has already been initialized.");const a=t._repoInternal;let i;if(a.repoInfo_.nodeAdmin)r.mockUserToken&&ui('mockUserToken is not supported by the Admin SDK. For client access with mock users, please use the "firebase" package instead of "firebase-admin".'),i=new Vf(Vf.OWNER);else if(r.mockUserToken){const s=typeof r.mockUserToken=="string"?r.mockUserToken:QI(r.mockUserToken,t.app.options.projectId);i=new Vf(s)}a9(a,e,n,i)}/** * @license * Copyright 2021 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function d9(t){Q6(Lo),vo(new ds("database",(e,{instanceIdentifier:n})=>{const r=e.getProvider("app").getImmediate(),a=e.getProvider("auth-internal"),i=e.getProvider("app-check-internal");return i9(r,a,i,n)},"PUBLIC").setMultipleInstances(!0)),Ca(GS,HS,t),Ca(GS,HS,"esm2017")}Za.prototype.simpleListen=function(t,e){this.sendRequest("q",{p:t},e)};Za.prototype.echo=function(t,e){this.sendRequest("echo",{d:t},e)};d9();function gE(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,r=Object.getOwnPropertySymbols(t);a"u")return null;const t=navigator;return t.languages&&t.languages[0]||t.language||null}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class lh{constructor(e,n){this.shortDelay=e,this.longDelay=n,ci(n>e,"Short delay should be less than long delay!"),this.isMobile=Py()||ZI()}get(){return m9()?this.isMobile?this.longDelay:this.shortDelay:Math.min(5e3,this.shortDelay)}}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function _E(t,e){ci(t.emulator,"Emulator should always be set here");const{url:n}=t.emulator;return e?`${n}${e.startsWith("/")?e.slice(1):e}`:n}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class RR{static initialize(e,n,r){this.fetchImpl=e,n&&(this.headersImpl=n),r&&(this.responseImpl=r)}static fetch(){if(this.fetchImpl)return this.fetchImpl;if(typeof self<"u"&&"fetch"in self)return self.fetch;if(typeof globalThis<"u"&&globalThis.fetch)return globalThis.fetch;if(typeof fetch<"u")return fetch;Ja("Could not find fetch implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static headers(){if(this.headersImpl)return this.headersImpl;if(typeof self<"u"&&"Headers"in self)return self.Headers;if(typeof globalThis<"u"&&globalThis.Headers)return globalThis.Headers;if(typeof Headers<"u")return Headers;Ja("Could not find Headers implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static response(){if(this.responseImpl)return this.responseImpl;if(typeof self<"u"&&"Response"in self)return self.Response;if(typeof globalThis<"u"&&globalThis.Response)return globalThis.Response;if(typeof Response<"u")return Response;Ja("Could not find Response implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const v9={CREDENTIAL_MISMATCH:"custom-token-mismatch",MISSING_CUSTOM_TOKEN:"internal-error",INVALID_IDENTIFIER:"invalid-email",MISSING_CONTINUE_URI:"internal-error",INVALID_PASSWORD:"wrong-password",MISSING_PASSWORD:"missing-password",INVALID_LOGIN_CREDENTIALS:"invalid-credential",EMAIL_EXISTS:"email-already-in-use",PASSWORD_LOGIN_DISABLED:"operation-not-allowed",INVALID_IDP_RESPONSE:"invalid-credential",INVALID_PENDING_TOKEN:"invalid-credential",FEDERATED_USER_ID_ALREADY_LINKED:"credential-already-in-use",MISSING_REQ_TYPE:"internal-error",EMAIL_NOT_FOUND:"user-not-found",RESET_PASSWORD_EXCEED_LIMIT:"too-many-requests",EXPIRED_OOB_CODE:"expired-action-code",INVALID_OOB_CODE:"invalid-action-code",MISSING_OOB_CODE:"internal-error",CREDENTIAL_TOO_OLD_LOGIN_AGAIN:"requires-recent-login",INVALID_ID_TOKEN:"invalid-user-token",TOKEN_EXPIRED:"user-token-expired",USER_NOT_FOUND:"user-token-expired",TOO_MANY_ATTEMPTS_TRY_LATER:"too-many-requests",PASSWORD_DOES_NOT_MEET_REQUIREMENTS:"password-does-not-meet-requirements",INVALID_CODE:"invalid-verification-code",INVALID_SESSION_INFO:"invalid-verification-id",INVALID_TEMPORARY_PROOF:"invalid-credential",MISSING_SESSION_INFO:"missing-verification-id",SESSION_EXPIRED:"code-expired",MISSING_ANDROID_PACKAGE_NAME:"missing-android-pkg-name",UNAUTHORIZED_DOMAIN:"unauthorized-continue-uri",INVALID_OAUTH_CLIENT_ID:"invalid-oauth-client-id",ADMIN_ONLY_OPERATION:"admin-restricted-operation",INVALID_MFA_PENDING_CREDENTIAL:"invalid-multi-factor-session",MFA_ENROLLMENT_NOT_FOUND:"multi-factor-info-not-found",MISSING_MFA_ENROLLMENT_ID:"missing-multi-factor-info",MISSING_MFA_PENDING_CREDENTIAL:"missing-multi-factor-session",SECOND_FACTOR_EXISTS:"second-factor-already-in-use",SECOND_FACTOR_LIMIT_EXCEEDED:"maximum-second-factor-count-exceeded",BLOCKING_FUNCTION_ERROR_RESPONSE:"internal-error",RECAPTCHA_NOT_ENABLED:"recaptcha-not-enabled",MISSING_RECAPTCHA_TOKEN:"missing-recaptcha-token",INVALID_RECAPTCHA_TOKEN:"invalid-recaptcha-token",INVALID_RECAPTCHA_ACTION:"invalid-recaptcha-action",MISSING_CLIENT_TYPE:"missing-client-type",MISSING_RECAPTCHA_VERSION:"missing-recaptcha-version",INVALID_RECAPTCHA_VERSION:"invalid-recaptcha-version",INVALID_REQ_TYPE:"invalid-req-type"};/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const _9=new lh(3e4,6e4);function Fo(t,e){return t.tenantId&&!e.tenantId?Object.assign(Object.assign({},e),{tenantId:t.tenantId}):e}async function Ps(t,e,n,r,a={}){return kR(t,a,async()=>{let i={},s={};r&&(e==="GET"?s=r:i={body:JSON.stringify(r)});const o=mu(Object.assign({key:t.config.apiKey},s)).slice(1),l=await t._getAdditionalHeaders();return l["Content-Type"]="application/json",t.languageCode&&(l["X-Firebase-Locale"]=t.languageCode),RR.fetch()(NR(t,t.config.apiHost,n,o),Object.assign({method:e,headers:l,referrerPolicy:"no-referrer"},i))})}async function kR(t,e,n){t._canInitEmulator=!1;const r=Object.assign(Object.assign({},v9),e);try{const a=new E9(t),i=await Promise.race([n(),a.promise]);a.clearNetworkTimeout();const s=await i.json();if("needConfirmation"in s)throw uf(t,"account-exists-with-different-credential",s);if(i.ok&&!("errorMessage"in s))return s;{const o=i.ok?s.errorMessage:s.error.message,[l,u]=o.split(" : ");if(l==="FEDERATED_USER_ID_ALREADY_LINKED")throw uf(t,"credential-already-in-use",s);if(l==="EMAIL_EXISTS")throw uf(t,"email-already-in-use",s);if(l==="USER_DISABLED")throw uf(t,"user-disabled",s);const c=r[l]||l.toLowerCase().replace(/[_\s]+/g,"-");if(u)throw PR(t,c,u);ua(t,c)}}catch(a){if(a instanceof vi)throw a;ua(t,"network-request-failed",{message:String(a)})}}async function sm(t,e,n,r,a={}){const i=await Ps(t,e,n,r,a);return"mfaPendingCredential"in i&&ua(t,"multi-factor-auth-required",{_serverResponse:i}),i}function NR(t,e,n,r){const a=`${e}${n}?${r}`;return t.config.emulator?_E(t.config,a):`${t.config.apiScheme}://${a}`}function y9(t){switch(t){case"ENFORCE":return"ENFORCE";case"AUDIT":return"AUDIT";case"OFF":return"OFF";default:return"ENFORCEMENT_STATE_UNSPECIFIED"}}class E9{constructor(e){this.auth=e,this.timer=null,this.promise=new Promise((n,r)=>{this.timer=setTimeout(()=>r(Aa(this.auth,"network-request-failed")),_9.get())})}clearNetworkTimeout(){clearTimeout(this.timer)}}function uf(t,e,n){const r={appName:t.name};n.email&&(r.email=n.email),n.phoneNumber&&(r.phoneNumber=n.phoneNumber);const a=Aa(t,e,r);return a.customData._tokenResponse=n,a}function CT(t){return t!==void 0&&t.enterprise!==void 0}class b9{constructor(e){if(this.siteKey="",this.recaptchaEnforcementState=[],e.recaptchaKey===void 0)throw new Error("recaptchaKey undefined");this.siteKey=e.recaptchaKey.split("/")[3],this.recaptchaEnforcementState=e.recaptchaEnforcementState}getProviderEnforcementState(e){if(!this.recaptchaEnforcementState||this.recaptchaEnforcementState.length===0)return null;for(const n of this.recaptchaEnforcementState)if(n.provider&&n.provider===e)return y9(n.enforcementState);return null}isProviderEnabled(e){return this.getProviderEnforcementState(e)==="ENFORCE"||this.getProviderEnforcementState(e)==="AUDIT"}}async function x9(t,e){return Ps(t,"GET","/v2/recaptchaConfig",Fo(t,e))}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */async function S9(t,e){return Ps(t,"POST","/v1/accounts:delete",e)}async function OR(t,e){return Ps(t,"POST","/v1/accounts:lookup",e)}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function Lc(t){if(t)try{const e=new Date(Number(t));if(!isNaN(e.getTime()))return e.toUTCString()}catch{}}async function T9(t,e=!1){const n=pn(t),r=await n.getIdToken(e),a=yE(r);Me(a&&a.exp&&a.auth_time&&a.iat,n.auth,"internal-error");const i=typeof a.firebase=="object"?a.firebase:void 0,s=i==null?void 0:i.sign_in_provider;return{claims:a,token:r,authTime:Lc(Vg(a.auth_time)),issuedAtTime:Lc(Vg(a.iat)),expirationTime:Lc(Vg(a.exp)),signInProvider:s||null,signInSecondFactor:(i==null?void 0:i.sign_in_second_factor)||null}}function Vg(t){return Number(t)*1e3}function yE(t){const[e,n,r]=t.split(".");if(e===void 0||n===void 0||r===void 0)return zf("JWT malformed, contained fewer than 3 sections"),null;try{const a=Pp(n);return a?JSON.parse(a):(zf("Failed to decode base64 JWT payload"),null)}catch(a){return zf("Caught error parsing JWT payload as JSON",a==null?void 0:a.toString()),null}}function AT(t){const e=yE(t);return Me(e,"internal-error"),Me(typeof e.exp<"u","internal-error"),Me(typeof e.iat<"u","internal-error"),Number(e.exp)-Number(e.iat)}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */async function wd(t,e,n=!1){if(n)return e;try{return await e}catch(r){throw r instanceof vi&&w9(r)&&t.auth.currentUser===t&&await t.auth.signOut(),r}}function w9({code:t}){return t==="auth/user-disabled"||t==="auth/user-token-expired"}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class C9{constructor(e){this.user=e,this.isRunning=!1,this.timerId=null,this.errorBackoff=3e4}_start(){this.isRunning||(this.isRunning=!0,this.schedule())}_stop(){this.isRunning&&(this.isRunning=!1,this.timerId!==null&&clearTimeout(this.timerId))}getInterval(e){var n;if(e){const r=this.errorBackoff;return this.errorBackoff=Math.min(this.errorBackoff*2,96e4),r}else{this.errorBackoff=3e4;const a=((n=this.user.stsTokenManager.expirationTime)!==null&&n!==void 0?n:0)-Date.now()-3e5;return Math.max(0,a)}}schedule(e=!1){if(!this.isRunning)return;const n=this.getInterval(e);this.timerId=setTimeout(async()=>{await this.iteration()},n)}async iteration(){try{await this.user.getIdToken(!0)}catch(e){(e==null?void 0:e.code)==="auth/network-request-failed"&&this.schedule(!0);return}this.schedule()}}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class D1{constructor(e,n){this.createdAt=e,this.lastLoginAt=n,this._initializeTime()}_initializeTime(){this.lastSignInTime=Lc(this.lastLoginAt),this.creationTime=Lc(this.createdAt)}_copy(e){this.createdAt=e.createdAt,this.lastLoginAt=e.lastLoginAt,this._initializeTime()}toJSON(){return{createdAt:this.createdAt,lastLoginAt:this.lastLoginAt}}}/** * @license * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */async function Wp(t){var e;const n=t.auth,r=await t.getIdToken(),a=await wd(t,OR(n,{idToken:r}));Me(a==null?void 0:a.users.length,n,"internal-error");const i=a.users[0];t._notifyReloadListener(i);const s=!((e=i.providerUserInfo)===null||e===void 0)&&e.length?MR(i.providerUserInfo):[],o=I9(t.providerData,s),l=t.isAnonymous,u=!(t.email&&i.passwordHash)&&!(o!=null&&o.length),c=l?u:!1,h={uid:i.localId,displayName:i.displayName||null,photoURL:i.photoUrl||null,email:i.email||null,emailVerified:i.emailVerified||!1,phoneNumber:i.phoneNumber||null,tenantId:i.tenantId||null,providerData:o,metadata:new D1(i.createdAt,i.lastLoginAt),isAnonymous:c};Object.assign(t,h)}async function A9(t){const e=pn(t);await Wp(e),await e.auth._persistUserIfCurrent(e),e.auth._notifyListenersIfCurrent(e)}function I9(t,e){return[...t.filter(r=>!e.some(a=>a.providerId===r.providerId)),...e]}function MR(t){return t.map(e=>{var{providerId:n}=e,r=gE(e,["providerId"]);return{providerId:n,uid:r.rawId||"",displayName:r.displayName||null,email:r.email||null,phoneNumber:r.phoneNumber||null,photoURL:r.photoUrl||null}})}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */async function P9(t,e){const n=await kR(t,{},async()=>{const r=mu({grant_type:"refresh_token",refresh_token:e}).slice(1),{tokenApiHost:a,apiKey:i}=t.config,s=NR(t,a,"/v1/token",`key=${i}`),o=await t._getAdditionalHeaders();return o["Content-Type"]="application/x-www-form-urlencoded",RR.fetch()(s,{method:"POST",headers:o,body:r})});return{accessToken:n.access_token,expiresIn:n.expires_in,refreshToken:n.refresh_token}}async function R9(t,e){return Ps(t,"POST","/v2/accounts:revokeToken",Fo(t,e))}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class kl{constructor(){this.refreshToken=null,this.accessToken=null,this.expirationTime=null}get isExpired(){return!this.expirationTime||Date.now()>this.expirationTime-3e4}updateFromServerResponse(e){Me(e.idToken,"internal-error"),Me(typeof e.idToken<"u","internal-error"),Me(typeof e.refreshToken<"u","internal-error");const n="expiresIn"in e&&typeof e.expiresIn<"u"?Number(e.expiresIn):AT(e.idToken);this.updateTokensAndExpiration(e.idToken,e.refreshToken,n)}updateFromIdToken(e){Me(e.length!==0,"internal-error");const n=AT(e);this.updateTokensAndExpiration(e,null,n)}async getToken(e,n=!1){return!n&&this.accessToken&&!this.isExpired?this.accessToken:(Me(this.refreshToken,e,"user-token-expired"),this.refreshToken?(await this.refresh(e,this.refreshToken),this.accessToken):null)}clearRefreshToken(){this.refreshToken=null}async refresh(e,n){const{accessToken:r,refreshToken:a,expiresIn:i}=await P9(e,n);this.updateTokensAndExpiration(r,a,Number(i))}updateTokensAndExpiration(e,n,r){this.refreshToken=n||null,this.accessToken=e||null,this.expirationTime=Date.now()+r*1e3}static fromJSON(e,n){const{refreshToken:r,accessToken:a,expirationTime:i}=n,s=new kl;return r&&(Me(typeof r=="string","internal-error",{appName:e}),s.refreshToken=r),a&&(Me(typeof a=="string","internal-error",{appName:e}),s.accessToken=a),i&&(Me(typeof i=="number","internal-error",{appName:e}),s.expirationTime=i),s}toJSON(){return{refreshToken:this.refreshToken,accessToken:this.accessToken,expirationTime:this.expirationTime}}_assign(e){this.accessToken=e.accessToken,this.refreshToken=e.refreshToken,this.expirationTime=e.expirationTime}_clone(){return Object.assign(new kl,this.toJSON())}_performRefresh(){return Ja("not implemented")}}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function Ii(t,e){Me(typeof t=="string"||typeof t>"u","internal-error",{appName:e})}class Ya{constructor(e){var{uid:n,auth:r,stsTokenManager:a}=e,i=gE(e,["uid","auth","stsTokenManager"]);this.providerId="firebase",this.proactiveRefresh=new C9(this),this.reloadUserInfo=null,this.reloadListener=null,this.uid=n,this.auth=r,this.stsTokenManager=a,this.accessToken=a.accessToken,this.displayName=i.displayName||null,this.email=i.email||null,this.emailVerified=i.emailVerified||!1,this.phoneNumber=i.phoneNumber||null,this.photoURL=i.photoURL||null,this.isAnonymous=i.isAnonymous||!1,this.tenantId=i.tenantId||null,this.providerData=i.providerData?[...i.providerData]:[],this.metadata=new D1(i.createdAt||void 0,i.lastLoginAt||void 0)}async getIdToken(e){const n=await wd(this,this.stsTokenManager.getToken(this.auth,e));return Me(n,this.auth,"internal-error"),this.accessToken!==n&&(this.accessToken=n,await this.auth._persistUserIfCurrent(this),this.auth._notifyListenersIfCurrent(this)),n}getIdTokenResult(e){return T9(this,e)}reload(){return A9(this)}_assign(e){this!==e&&(Me(this.uid===e.uid,this.auth,"internal-error"),this.displayName=e.displayName,this.photoURL=e.photoURL,this.email=e.email,this.emailVerified=e.emailVerified,this.phoneNumber=e.phoneNumber,this.isAnonymous=e.isAnonymous,this.tenantId=e.tenantId,this.providerData=e.providerData.map(n=>Object.assign({},n)),this.metadata._copy(e.metadata),this.stsTokenManager._assign(e.stsTokenManager))}_clone(e){const n=new Ya(Object.assign(Object.assign({},this),{auth:e,stsTokenManager:this.stsTokenManager._clone()}));return n.metadata._copy(this.metadata),n}_onReload(e){Me(!this.reloadListener,this.auth,"internal-error"),this.reloadListener=e,this.reloadUserInfo&&(this._notifyReloadListener(this.reloadUserInfo),this.reloadUserInfo=null)}_notifyReloadListener(e){this.reloadListener?this.reloadListener(e):this.reloadUserInfo=e}_startProactiveRefresh(){this.proactiveRefresh._start()}_stopProactiveRefresh(){this.proactiveRefresh._stop()}async _updateTokensIfNecessary(e,n=!1){let r=!1;e.idToken&&e.idToken!==this.stsTokenManager.accessToken&&(this.stsTokenManager.updateFromServerResponse(e),r=!0),n&&await Wp(this),await this.auth._persistUserIfCurrent(this),r&&this.auth._notifyListenersIfCurrent(this)}async delete(){if($a(this.auth.app))return Promise.reject(ls(this.auth));const e=await this.getIdToken();return await wd(this,S9(this.auth,{idToken:e})),this.stsTokenManager.clearRefreshToken(),this.auth.signOut()}toJSON(){return Object.assign(Object.assign({uid:this.uid,email:this.email||void 0,emailVerified:this.emailVerified,displayName:this.displayName||void 0,isAnonymous:this.isAnonymous,photoURL:this.photoURL||void 0,phoneNumber:this.phoneNumber||void 0,tenantId:this.tenantId||void 0,providerData:this.providerData.map(e=>Object.assign({},e)),stsTokenManager:this.stsTokenManager.toJSON(),_redirectEventId:this._redirectEventId},this.metadata.toJSON()),{apiKey:this.auth.config.apiKey,appName:this.auth.name})}get refreshToken(){return this.stsTokenManager.refreshToken||""}static _fromJSON(e,n){var r,a,i,s,o,l,u,c;const h=(r=n.displayName)!==null&&r!==void 0?r:void 0,f=(a=n.email)!==null&&a!==void 0?a:void 0,p=(i=n.phoneNumber)!==null&&i!==void 0?i:void 0,g=(s=n.photoURL)!==null&&s!==void 0?s:void 0,m=(o=n.tenantId)!==null&&o!==void 0?o:void 0,_=(l=n._redirectEventId)!==null&&l!==void 0?l:void 0,x=(u=n.createdAt)!==null&&u!==void 0?u:void 0,E=(c=n.lastLoginAt)!==null&&c!==void 0?c:void 0,{uid:y,emailVerified:I,isAnonymous:j,providerData:G,stsTokenManager:T}=n;Me(y&&T,e,"internal-error");const S=kl.fromJSON(this.name,T);Me(typeof y=="string",e,"internal-error"),Ii(h,e.name),Ii(f,e.name),Me(typeof I=="boolean",e,"internal-error"),Me(typeof j=="boolean",e,"internal-error"),Ii(p,e.name),Ii(g,e.name),Ii(m,e.name),Ii(_,e.name),Ii(x,e.name),Ii(E,e.name);const w=new Ya({uid:y,auth:e,email:f,emailVerified:I,displayName:h,isAnonymous:j,photoURL:g,phoneNumber:p,tenantId:m,stsTokenManager:S,createdAt:x,lastLoginAt:E});return G&&Array.isArray(G)&&(w.providerData=G.map(A=>Object.assign({},A))),_&&(w._redirectEventId=_),w}static async _fromIdTokenResponse(e,n,r=!1){const a=new kl;a.updateFromServerResponse(n);const i=new Ya({uid:n.localId,auth:e,stsTokenManager:a,isAnonymous:r});return await Wp(i),i}static async _fromGetAccountInfoResponse(e,n,r){const a=n.users[0];Me(a.localId!==void 0,"internal-error");const i=a.providerUserInfo!==void 0?MR(a.providerUserInfo):[],s=!(a.email&&a.passwordHash)&&!(i!=null&&i.length),o=new kl;o.updateFromIdToken(r);const l=new Ya({uid:a.localId,auth:e,stsTokenManager:o,isAnonymous:s}),u={uid:a.localId,displayName:a.displayName||null,photoURL:a.photoUrl||null,email:a.email||null,emailVerified:a.emailVerified||!1,phoneNumber:a.phoneNumber||null,tenantId:a.tenantId||null,providerData:i,metadata:new D1(a.createdAt,a.lastLoginAt),isAnonymous:!(a.email&&a.passwordHash)&&!(i!=null&&i.length)};return Object.assign(l,u),l}}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const IT=new Map;function Xa(t){ci(t instanceof Function,"Expected a class definition");let e=IT.get(t);return e?(ci(e instanceof t,"Instance stored in cache mismatched with class"),e):(e=new t,IT.set(t,e),e)}/** * @license * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class LR{constructor(){this.type="NONE",this.storage={}}async _isAvailable(){return!0}async _set(e,n){this.storage[e]=n}async _get(e){const n=this.storage[e];return n===void 0?null:n}async _remove(e){delete this.storage[e]}_addListener(e,n){}_removeListener(e,n){}}LR.type="NONE";const PT=LR;/** * @license * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function qf(t,e,n){return`firebase:${t}:${e}:${n}`}class Nl{constructor(e,n,r){this.persistence=e,this.auth=n,this.userKey=r;const{config:a,name:i}=this.auth;this.fullUserKey=qf(this.userKey,a.apiKey,i),this.fullPersistenceKey=qf("persistence",a.apiKey,i),this.boundEventHandler=n._onStorageEvent.bind(n),this.persistence._addListener(this.fullUserKey,this.boundEventHandler)}setCurrentUser(e){return this.persistence._set(this.fullUserKey,e.toJSON())}async getCurrentUser(){const e=await this.persistence._get(this.fullUserKey);return e?Ya._fromJSON(this.auth,e):null}removeCurrentUser(){return this.persistence._remove(this.fullUserKey)}savePersistenceForRedirect(){return this.persistence._set(this.fullPersistenceKey,this.persistence.type)}async setPersistence(e){if(this.persistence===e)return;const n=await this.getCurrentUser();if(await this.removeCurrentUser(),this.persistence=e,n)return this.setCurrentUser(n)}delete(){this.persistence._removeListener(this.fullUserKey,this.boundEventHandler)}static async create(e,n,r="authUser"){if(!n.length)return new Nl(Xa(PT),e,r);const a=(await Promise.all(n.map(async u=>{if(await u._isAvailable())return u}))).filter(u=>u);let i=a[0]||Xa(PT);const s=qf(r,e.config.apiKey,e.name);let o=null;for(const u of n)try{const c=await u._get(s);if(c){const h=Ya._fromJSON(e,c);u!==i&&(o=h),i=u;break}}catch{}const l=a.filter(u=>u._shouldAllowMigration);return!i._shouldAllowMigration||!l.length?new Nl(i,e,r):(i=l[0],o&&await i._set(s,o.toJSON()),await Promise.all(n.map(async u=>{if(u!==i)try{await u._remove(s)}catch{}})),new Nl(i,e,r))}}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function RT(t){const e=t.toLowerCase();if(e.includes("opera/")||e.includes("opr/")||e.includes("opios/"))return"Opera";if(UR(e))return"IEMobile";if(e.includes("msie")||e.includes("trident/"))return"IE";if(e.includes("edge/"))return"Edge";if(DR(e))return"Firefox";if(e.includes("silk/"))return"Silk";if(jR(e))return"Blackberry";if(zR(e))return"Webos";if(FR(e))return"Safari";if((e.includes("chrome/")||BR(e))&&!e.includes("edge/"))return"Chrome";if(VR(e))return"Android";{const n=/([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/,r=t.match(n);if((r==null?void 0:r.length)===2)return r[1]}return"Other"}function DR(t=zn()){return/firefox\//i.test(t)}function FR(t=zn()){const e=t.toLowerCase();return e.includes("safari/")&&!e.includes("chrome/")&&!e.includes("crios/")&&!e.includes("android")}function BR(t=zn()){return/crios\//i.test(t)}function UR(t=zn()){return/iemobile/i.test(t)}function VR(t=zn()){return/android/i.test(t)}function jR(t=zn()){return/blackberry/i.test(t)}function zR(t=zn()){return/webos/i.test(t)}function EE(t=zn()){return/iphone|ipad|ipod/i.test(t)||/macintosh/i.test(t)&&/mobile/i.test(t)}function k9(t=zn()){var e;return EE(t)&&!!(!((e=window.navigator)===null||e===void 0)&&e.standalone)}function N9(){return RF()&&document.documentMode===10}function qR(t=zn()){return EE(t)||VR(t)||zR(t)||jR(t)||/windows phone/i.test(t)||UR(t)}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function GR(t,e=[]){let n;switch(t){case"Browser":n=RT(zn());break;case"Worker":n=`${RT(zn())}-${t}`;break;default:n=t}const r=e.length?e.join(","):"FirebaseCore-web";return`${n}/JsCore/${Lo}/${r}`}/** * @license * Copyright 2022 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class O9{constructor(e){this.auth=e,this.queue=[]}pushCallback(e,n){const r=i=>new Promise((s,o)=>{try{const l=e(i);s(l)}catch(l){o(l)}});r.onAbort=n,this.queue.push(r);const a=this.queue.length-1;return()=>{this.queue[a]=()=>Promise.resolve()}}async runMiddleware(e){if(this.auth.currentUser===e)return;const n=[];try{for(const r of this.queue)await r(e),r.onAbort&&n.push(r.onAbort)}catch(r){n.reverse();for(const a of n)try{a()}catch{}throw this.auth._errorFactory.create("login-blocked",{originalMessage:r==null?void 0:r.message})}}}/** * @license * Copyright 2023 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */async function M9(t,e={}){return Ps(t,"GET","/v2/passwordPolicy",Fo(t,e))}/** * @license * Copyright 2023 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const L9=6;class D9{constructor(e){var n,r,a,i;const s=e.customStrengthOptions;this.customStrengthOptions={},this.customStrengthOptions.minPasswordLength=(n=s.minPasswordLength)!==null&&n!==void 0?n:L9,s.maxPasswordLength&&(this.customStrengthOptions.maxPasswordLength=s.maxPasswordLength),s.containsLowercaseCharacter!==void 0&&(this.customStrengthOptions.containsLowercaseLetter=s.containsLowercaseCharacter),s.containsUppercaseCharacter!==void 0&&(this.customStrengthOptions.containsUppercaseLetter=s.containsUppercaseCharacter),s.containsNumericCharacter!==void 0&&(this.customStrengthOptions.containsNumericCharacter=s.containsNumericCharacter),s.containsNonAlphanumericCharacter!==void 0&&(this.customStrengthOptions.containsNonAlphanumericCharacter=s.containsNonAlphanumericCharacter),this.enforcementState=e.enforcementState,this.enforcementState==="ENFORCEMENT_STATE_UNSPECIFIED"&&(this.enforcementState="OFF"),this.allowedNonAlphanumericCharacters=(a=(r=e.allowedNonAlphanumericCharacters)===null||r===void 0?void 0:r.join(""))!==null&&a!==void 0?a:"",this.forceUpgradeOnSignin=(i=e.forceUpgradeOnSignin)!==null&&i!==void 0?i:!1,this.schemaVersion=e.schemaVersion}validatePassword(e){var n,r,a,i,s,o;const l={isValid:!0,passwordPolicy:this};return this.validatePasswordLengthOptions(e,l),this.validatePasswordCharacterOptions(e,l),l.isValid&&(l.isValid=(n=l.meetsMinPasswordLength)!==null&&n!==void 0?n:!0),l.isValid&&(l.isValid=(r=l.meetsMaxPasswordLength)!==null&&r!==void 0?r:!0),l.isValid&&(l.isValid=(a=l.containsLowercaseLetter)!==null&&a!==void 0?a:!0),l.isValid&&(l.isValid=(i=l.containsUppercaseLetter)!==null&&i!==void 0?i:!0),l.isValid&&(l.isValid=(s=l.containsNumericCharacter)!==null&&s!==void 0?s:!0),l.isValid&&(l.isValid=(o=l.containsNonAlphanumericCharacter)!==null&&o!==void 0?o:!0),l}validatePasswordLengthOptions(e,n){const r=this.customStrengthOptions.minPasswordLength,a=this.customStrengthOptions.maxPasswordLength;r&&(n.meetsMinPasswordLength=e.length>=r),a&&(n.meetsMaxPasswordLength=e.length<=a)}validatePasswordCharacterOptions(e,n){this.updatePasswordCharacterOptionsStatuses(n,!1,!1,!1,!1);let r;for(let a=0;a="a"&&r<="z",r>="A"&&r<="Z",r>="0"&&r<="9",this.allowedNonAlphanumericCharacters.includes(r))}updatePasswordCharacterOptionsStatuses(e,n,r,a,i){this.customStrengthOptions.containsLowercaseLetter&&(e.containsLowercaseLetter||(e.containsLowercaseLetter=n)),this.customStrengthOptions.containsUppercaseLetter&&(e.containsUppercaseLetter||(e.containsUppercaseLetter=r)),this.customStrengthOptions.containsNumericCharacter&&(e.containsNumericCharacter||(e.containsNumericCharacter=a)),this.customStrengthOptions.containsNonAlphanumericCharacter&&(e.containsNonAlphanumericCharacter||(e.containsNonAlphanumericCharacter=i))}}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class F9{constructor(e,n,r,a){this.app=e,this.heartbeatServiceProvider=n,this.appCheckServiceProvider=r,this.config=a,this.currentUser=null,this.emulatorConfig=null,this.operations=Promise.resolve(),this.authStateSubscription=new kT(this),this.idTokenSubscription=new kT(this),this.beforeStateQueue=new O9(this),this.redirectUser=null,this.isProactiveRefreshEnabled=!1,this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION=1,this._canInitEmulator=!0,this._isInitialized=!1,this._deleted=!1,this._initializationPromise=null,this._popupRedirectResolver=null,this._errorFactory=IR,this._agentRecaptchaConfig=null,this._tenantRecaptchaConfigs={},this._projectPasswordPolicy=null,this._tenantPasswordPolicies={},this.lastNotifiedUid=void 0,this.languageCode=null,this.tenantId=null,this.settings={appVerificationDisabledForTesting:!1},this.frameworks=[],this.name=e.name,this.clientVersion=a.sdkClientVersion}_initializeWithPersistence(e,n){return n&&(this._popupRedirectResolver=Xa(n)),this._initializationPromise=this.queue(async()=>{var r,a;if(!this._deleted&&(this.persistenceManager=await Nl.create(this,e),!this._deleted)){if(!((r=this._popupRedirectResolver)===null||r===void 0)&&r._shouldInitProactively)try{await this._popupRedirectResolver._initialize(this)}catch{}await this.initializeCurrentUser(n),this.lastNotifiedUid=((a=this.currentUser)===null||a===void 0?void 0:a.uid)||null,!this._deleted&&(this._isInitialized=!0)}}),this._initializationPromise}async _onStorageEvent(){if(this._deleted)return;const e=await this.assertedPersistence.getCurrentUser();if(!(!this.currentUser&&!e)){if(this.currentUser&&e&&this.currentUser.uid===e.uid){this._currentUser._assign(e),await this.currentUser.getIdToken();return}await this._updateCurrentUser(e,!0)}}async initializeCurrentUserFromIdToken(e){try{const n=await OR(this,{idToken:e}),r=await Ya._fromGetAccountInfoResponse(this,n,e);await this.directlySetCurrentUser(r)}catch(n){console.warn("FirebaseServerApp could not login user with provided authIdToken: ",n),await this.directlySetCurrentUser(null)}}async initializeCurrentUser(e){var n;if($a(this.app)){const s=this.app.settings.authIdToken;return s?new Promise(o=>{setTimeout(()=>this.initializeCurrentUserFromIdToken(s).then(o,o))}):this.directlySetCurrentUser(null)}const r=await this.assertedPersistence.getCurrentUser();let a=r,i=!1;if(e&&this.config.authDomain){await this.getOrInitRedirectPersistenceManager();const s=(n=this.redirectUser)===null||n===void 0?void 0:n._redirectEventId,o=a==null?void 0:a._redirectEventId,l=await this.tryRedirectSignIn(e);(!s||s===o)&&(l!=null&&l.user)&&(a=l.user,i=!0)}if(!a)return this.directlySetCurrentUser(null);if(!a._redirectEventId){if(i)try{await this.beforeStateQueue.runMiddleware(a)}catch(s){a=r,this._popupRedirectResolver._overrideRedirectResult(this,()=>Promise.reject(s))}return a?this.reloadAndSetCurrentUserOrClear(a):this.directlySetCurrentUser(null)}return Me(this._popupRedirectResolver,this,"argument-error"),await this.getOrInitRedirectPersistenceManager(),this.redirectUser&&this.redirectUser._redirectEventId===a._redirectEventId?this.directlySetCurrentUser(a):this.reloadAndSetCurrentUserOrClear(a)}async tryRedirectSignIn(e){let n=null;try{n=await this._popupRedirectResolver._completeRedirectFn(this,e,!0)}catch{await this._setRedirectUser(null)}return n}async reloadAndSetCurrentUserOrClear(e){try{await Wp(e)}catch(n){if((n==null?void 0:n.code)!=="auth/network-request-failed")return this.directlySetCurrentUser(null)}return this.directlySetCurrentUser(e)}useDeviceLanguage(){this.languageCode=g9()}async _delete(){this._deleted=!0}async updateCurrentUser(e){if($a(this.app))return Promise.reject(ls(this));const n=e?pn(e):null;return n&&Me(n.auth.config.apiKey===this.config.apiKey,this,"invalid-user-token"),this._updateCurrentUser(n&&n._clone(this))}async _updateCurrentUser(e,n=!1){if(!this._deleted)return e&&Me(this.tenantId===e.tenantId,this,"tenant-id-mismatch"),n||await this.beforeStateQueue.runMiddleware(e),this.queue(async()=>{await this.directlySetCurrentUser(e),this.notifyAuthListeners()})}async signOut(){return $a(this.app)?Promise.reject(ls(this)):(await this.beforeStateQueue.runMiddleware(null),(this.redirectPersistenceManager||this._popupRedirectResolver)&&await this._setRedirectUser(null),this._updateCurrentUser(null,!0))}setPersistence(e){return $a(this.app)?Promise.reject(ls(this)):this.queue(async()=>{await this.assertedPersistence.setPersistence(Xa(e))})}_getRecaptchaConfig(){return this.tenantId==null?this._agentRecaptchaConfig:this._tenantRecaptchaConfigs[this.tenantId]}async validatePassword(e){this._getPasswordPolicyInternal()||await this._updatePasswordPolicy();const n=this._getPasswordPolicyInternal();return n.schemaVersion!==this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION?Promise.reject(this._errorFactory.create("unsupported-password-policy-schema-version",{})):n.validatePassword(e)}_getPasswordPolicyInternal(){return this.tenantId===null?this._projectPasswordPolicy:this._tenantPasswordPolicies[this.tenantId]}async _updatePasswordPolicy(){const e=await M9(this),n=new D9(e);this.tenantId===null?this._projectPasswordPolicy=n:this._tenantPasswordPolicies[this.tenantId]=n}_getPersistence(){return this.assertedPersistence.persistence.type}_updateErrorMap(e){this._errorFactory=new eh("auth","Firebase",e())}onAuthStateChanged(e,n,r){return this.registerStateListener(this.authStateSubscription,e,n,r)}beforeAuthStateChanged(e,n){return this.beforeStateQueue.pushCallback(e,n)}onIdTokenChanged(e,n,r){return this.registerStateListener(this.idTokenSubscription,e,n,r)}authStateReady(){return new Promise((e,n)=>{if(this.currentUser)e();else{const r=this.onAuthStateChanged(()=>{r(),e()},n)}})}async revokeAccessToken(e){if(this.currentUser){const n=await this.currentUser.getIdToken(),r={providerId:"apple.com",tokenType:"ACCESS_TOKEN",token:e,idToken:n};this.tenantId!=null&&(r.tenantId=this.tenantId),await R9(this,r)}}toJSON(){var e;return{apiKey:this.config.apiKey,authDomain:this.config.authDomain,appName:this.name,currentUser:(e=this._currentUser)===null||e===void 0?void 0:e.toJSON()}}async _setRedirectUser(e,n){const r=await this.getOrInitRedirectPersistenceManager(n);return e===null?r.removeCurrentUser():r.setCurrentUser(e)}async getOrInitRedirectPersistenceManager(e){if(!this.redirectPersistenceManager){const n=e&&Xa(e)||this._popupRedirectResolver;Me(n,this,"argument-error"),this.redirectPersistenceManager=await Nl.create(this,[Xa(n._redirectPersistence)],"redirectUser"),this.redirectUser=await this.redirectPersistenceManager.getCurrentUser()}return this.redirectPersistenceManager}async _redirectUserForId(e){var n,r;return this._isInitialized&&await this.queue(async()=>{}),((n=this._currentUser)===null||n===void 0?void 0:n._redirectEventId)===e?this._currentUser:((r=this.redirectUser)===null||r===void 0?void 0:r._redirectEventId)===e?this.redirectUser:null}async _persistUserIfCurrent(e){if(e===this.currentUser)return this.queue(async()=>this.directlySetCurrentUser(e))}_notifyListenersIfCurrent(e){e===this.currentUser&&this.notifyAuthListeners()}_key(){return`${this.config.authDomain}:${this.config.apiKey}:${this.name}`}_startProactiveRefresh(){this.isProactiveRefreshEnabled=!0,this.currentUser&&this._currentUser._startProactiveRefresh()}_stopProactiveRefresh(){this.isProactiveRefreshEnabled=!1,this.currentUser&&this._currentUser._stopProactiveRefresh()}get _currentUser(){return this.currentUser}notifyAuthListeners(){var e,n;if(!this._isInitialized)return;this.idTokenSubscription.next(this.currentUser);const r=(n=(e=this.currentUser)===null||e===void 0?void 0:e.uid)!==null&&n!==void 0?n:null;this.lastNotifiedUid!==r&&(this.lastNotifiedUid=r,this.authStateSubscription.next(this.currentUser))}registerStateListener(e,n,r,a){if(this._deleted)return()=>{};const i=typeof n=="function"?n:n.next.bind(n);let s=!1;const o=this._isInitialized?Promise.resolve():this._initializationPromise;if(Me(o,this,"internal-error"),o.then(()=>{s||i(this.currentUser)}),typeof n=="function"){const l=e.addObserver(n,r,a);return()=>{s=!0,l()}}else{const l=e.addObserver(n);return()=>{s=!0,l()}}}async directlySetCurrentUser(e){this.currentUser&&this.currentUser!==e&&this._currentUser._stopProactiveRefresh(),e&&this.isProactiveRefreshEnabled&&e._startProactiveRefresh(),this.currentUser=e,e?await this.assertedPersistence.setCurrentUser(e):await this.assertedPersistence.removeCurrentUser()}queue(e){return this.operations=this.operations.then(e,e),this.operations}get assertedPersistence(){return Me(this.persistenceManager,this,"internal-error"),this.persistenceManager}_logFramework(e){!e||this.frameworks.includes(e)||(this.frameworks.push(e),this.frameworks.sort(),this.clientVersion=GR(this.config.clientPlatform,this._getFrameworks()))}_getFrameworks(){return this.frameworks}async _getAdditionalHeaders(){var e;const n={"X-Client-Version":this.clientVersion};this.app.options.appId&&(n["X-Firebase-gmpid"]=this.app.options.appId);const r=await((e=this.heartbeatServiceProvider.getImmediate({optional:!0}))===null||e===void 0?void 0:e.getHeartbeatsHeader());r&&(n["X-Firebase-Client"]=r);const a=await this._getAppCheckToken();return a&&(n["X-Firebase-AppCheck"]=a),n}async _getAppCheckToken(){var e;const n=await((e=this.appCheckServiceProvider.getImmediate({optional:!0}))===null||e===void 0?void 0:e.getToken());return n!=null&&n.error&&f9(`Error while retrieving App Check token: ${n.error}`),n==null?void 0:n.token}}function Eu(t){return pn(t)}class kT{constructor(e){this.auth=e,this.observer=null,this.addObserver=VF(n=>this.observer=n)}get next(){return Me(this.observer,this.auth,"internal-error"),this.observer.next.bind(this.observer)}}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */let om={async loadJS(){throw new Error("Unable to load external scripts")},recaptchaV2Script:"",recaptchaEnterpriseScript:"",gapiScript:""};function B9(t){om=t}function HR(t){return om.loadJS(t)}function U9(){return om.recaptchaEnterpriseScript}function V9(){return om.gapiScript}function j9(t){return`__${t}${Math.floor(Math.random()*1e6)}`}const z9="recaptcha-enterprise",q9="NO_RECAPTCHA";class G9{constructor(e){this.type=z9,this.auth=Eu(e)}async verify(e="verify",n=!1){async function r(i){if(!n){if(i.tenantId==null&&i._agentRecaptchaConfig!=null)return i._agentRecaptchaConfig.siteKey;if(i.tenantId!=null&&i._tenantRecaptchaConfigs[i.tenantId]!==void 0)return i._tenantRecaptchaConfigs[i.tenantId].siteKey}return new Promise(async(s,o)=>{x9(i,{clientType:"CLIENT_TYPE_WEB",version:"RECAPTCHA_ENTERPRISE"}).then(l=>{if(l.recaptchaKey===void 0)o(new Error("recaptcha Enterprise site key undefined"));else{const u=new b9(l);return i.tenantId==null?i._agentRecaptchaConfig=u:i._tenantRecaptchaConfigs[i.tenantId]=u,s(u.siteKey)}}).catch(l=>{o(l)})})}function a(i,s,o){const l=window.grecaptcha;CT(l)?l.enterprise.ready(()=>{l.enterprise.execute(i,{action:e}).then(u=>{s(u)}).catch(()=>{s(q9)})}):o(Error("No reCAPTCHA enterprise script loaded."))}return new Promise((i,s)=>{r(this.auth).then(o=>{if(!n&&CT(window.grecaptcha))a(o,i,s);else{if(typeof window>"u"){s(new Error("RecaptchaVerifier is only supported in browser"));return}let l=U9();l.length!==0&&(l+=o),HR(l).then(()=>{a(o,i,s)}).catch(u=>{s(u)})}}).catch(o=>{s(o)})})}}async function NT(t,e,n,r=!1){const a=new G9(t);let i;try{i=await a.verify(n)}catch{i=await a.verify(n,!0)}const s=Object.assign({},e);return r?Object.assign(s,{captchaResp:i}):Object.assign(s,{captchaResponse:i}),Object.assign(s,{clientType:"CLIENT_TYPE_WEB"}),Object.assign(s,{recaptchaVersion:"RECAPTCHA_ENTERPRISE"}),s}async function OT(t,e,n,r){var a;if(!((a=t._getRecaptchaConfig())===null||a===void 0)&&a.isProviderEnabled("EMAIL_PASSWORD_PROVIDER")){const i=await NT(t,e,n,n==="getOobCode");return r(t,i)}else return r(t,e).catch(async i=>{if(i.code==="auth/missing-recaptcha-token"){console.log(`${n} is protected by reCAPTCHA Enterprise for this project. Automatically triggering the reCAPTCHA flow and restarting the flow.`);const s=await NT(t,e,n,n==="getOobCode");return r(t,s)}else return Promise.reject(i)})}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function H9(t,e){const n=J0(t,"auth");if(n.isInitialized()){const a=n.getImmediate(),i=n.getOptions();if(kp(i,e??{}))return a;ua(a,"already-initialized")}return n.initialize({options:e})}function W9(t,e){const n=(e==null?void 0:e.persistence)||[],r=(Array.isArray(n)?n:[n]).map(Xa);e!=null&&e.errorMap&&t._updateErrorMap(e.errorMap),t._initializeWithPersistence(r,e==null?void 0:e.popupRedirectResolver)}function $9(t,e,n){const r=Eu(t);Me(r._canInitEmulator,r,"emulator-config-failed"),Me(/^https?:\/\//.test(e),r,"invalid-emulator-scheme");const a=!1,i=WR(e),{host:s,port:o}=K9(e),l=o===null?"":`:${o}`;r.config.emulator={url:`${i}//${s}${l}/`},r.settings.appVerificationDisabledForTesting=!0,r.emulatorConfig=Object.freeze({host:s,port:o,protocol:i.replace(":",""),options:Object.freeze({disableWarnings:a})}),J9()}function WR(t){const e=t.indexOf(":");return e<0?"":t.substr(0,e+1)}function K9(t){const e=WR(t),n=/(\/\/)?([^?#/]+)/.exec(t.substr(e.length));if(!n)return{host:"",port:null};const r=n[2].split("@").pop()||"",a=/^(\[[^\]]+\])(:|$)/.exec(r);if(a){const i=a[1];return{host:i,port:MT(r.substr(i.length+1))}}else{const[i,s]=r.split(":");return{host:i,port:MT(s)}}}function MT(t){if(!t)return null;const e=Number(t);return isNaN(e)?null:e}function J9(){function t(){const e=document.createElement("p"),n=e.style;e.innerText="Running in emulator mode. Do not use with production credentials.",n.position="fixed",n.width="100%",n.backgroundColor="#ffffff",n.border=".1em solid #000000",n.color="#b50000",n.bottom="0px",n.left="0px",n.margin="0px",n.zIndex="10000",n.textAlign="center",e.classList.add("firebase-emulator-warning"),document.body.appendChild(e)}typeof console<"u"&&typeof console.info=="function"&&console.info("WARNING: You are using the Auth Emulator, which is intended for local testing only. Do not use with production credentials."),typeof window<"u"&&typeof document<"u"&&(document.readyState==="loading"?window.addEventListener("DOMContentLoaded",t):t())}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class bE{constructor(e,n){this.providerId=e,this.signInMethod=n}toJSON(){return Ja("not implemented")}_getIdTokenResponse(e){return Ja("not implemented")}_linkToIdToken(e,n){return Ja("not implemented")}_getReauthenticationResolver(e){return Ja("not implemented")}}async function Y9(t,e){return Ps(t,"POST","/v1/accounts:signUp",e)}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */async function X9(t,e){return sm(t,"POST","/v1/accounts:signInWithPassword",Fo(t,e))}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */async function Q9(t,e){return sm(t,"POST","/v1/accounts:signInWithEmailLink",Fo(t,e))}async function Z9(t,e){return sm(t,"POST","/v1/accounts:signInWithEmailLink",Fo(t,e))}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class Cd extends bE{constructor(e,n,r,a=null){super("password",r),this._email=e,this._password=n,this._tenantId=a}static _fromEmailAndPassword(e,n){return new Cd(e,n,"password")}static _fromEmailAndCode(e,n,r=null){return new Cd(e,n,"emailLink",r)}toJSON(){return{email:this._email,password:this._password,signInMethod:this.signInMethod,tenantId:this._tenantId}}static fromJSON(e){const n=typeof e=="string"?JSON.parse(e):e;if(n!=null&&n.email&&(n!=null&&n.password)){if(n.signInMethod==="password")return this._fromEmailAndPassword(n.email,n.password);if(n.signInMethod==="emailLink")return this._fromEmailAndCode(n.email,n.password,n.tenantId)}return null}async _getIdTokenResponse(e){switch(this.signInMethod){case"password":const n={returnSecureToken:!0,email:this._email,password:this._password,clientType:"CLIENT_TYPE_WEB"};return OT(e,n,"signInWithPassword",X9);case"emailLink":return Q9(e,{email:this._email,oobCode:this._password});default:ua(e,"internal-error")}}async _linkToIdToken(e,n){switch(this.signInMethod){case"password":const r={idToken:n,returnSecureToken:!0,email:this._email,password:this._password,clientType:"CLIENT_TYPE_WEB"};return OT(e,r,"signUpPassword",Y9);case"emailLink":return Z9(e,{idToken:n,email:this._email,oobCode:this._password});default:ua(e,"internal-error")}}_getReauthenticationResolver(e){return this._getIdTokenResponse(e)}}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */async function Ol(t,e){return sm(t,"POST","/v1/accounts:signInWithIdp",Fo(t,e))}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const e7="http://localhost";class bo extends bE{constructor(){super(...arguments),this.pendingToken=null}static _fromParams(e){const n=new bo(e.providerId,e.signInMethod);return e.idToken||e.accessToken?(e.idToken&&(n.idToken=e.idToken),e.accessToken&&(n.accessToken=e.accessToken),e.nonce&&!e.pendingToken&&(n.nonce=e.nonce),e.pendingToken&&(n.pendingToken=e.pendingToken)):e.oauthToken&&e.oauthTokenSecret?(n.accessToken=e.oauthToken,n.secret=e.oauthTokenSecret):ua("argument-error"),n}toJSON(){return{idToken:this.idToken,accessToken:this.accessToken,secret:this.secret,nonce:this.nonce,pendingToken:this.pendingToken,providerId:this.providerId,signInMethod:this.signInMethod}}static fromJSON(e){const n=typeof e=="string"?JSON.parse(e):e,{providerId:r,signInMethod:a}=n,i=gE(n,["providerId","signInMethod"]);if(!r||!a)return null;const s=new bo(r,a);return s.idToken=i.idToken||void 0,s.accessToken=i.accessToken||void 0,s.secret=i.secret,s.nonce=i.nonce,s.pendingToken=i.pendingToken||null,s}_getIdTokenResponse(e){const n=this.buildRequest();return Ol(e,n)}_linkToIdToken(e,n){const r=this.buildRequest();return r.idToken=n,Ol(e,r)}_getReauthenticationResolver(e){const n=this.buildRequest();return n.autoCreate=!1,Ol(e,n)}buildRequest(){const e={requestUri:e7,returnSecureToken:!0};if(this.pendingToken)e.pendingToken=this.pendingToken;else{const n={};this.idToken&&(n.id_token=this.idToken),this.accessToken&&(n.access_token=this.accessToken),this.secret&&(n.oauth_token_secret=this.secret),n.providerId=this.providerId,this.nonce&&!this.pendingToken&&(n.nonce=this.nonce),e.postBody=mu(n)}return e}}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function t7(t){switch(t){case"recoverEmail":return"RECOVER_EMAIL";case"resetPassword":return"PASSWORD_RESET";case"signIn":return"EMAIL_SIGNIN";case"verifyEmail":return"VERIFY_EMAIL";case"verifyAndChangeEmail":return"VERIFY_AND_CHANGE_EMAIL";case"revertSecondFactorAddition":return"REVERT_SECOND_FACTOR_ADDITION";default:return null}}function n7(t){const e=hc(fc(t)).link,n=e?hc(fc(e)).deep_link_id:null,r=hc(fc(t)).deep_link_id;return(r?hc(fc(r)).link:null)||r||n||e||t}class xE{constructor(e){var n,r,a,i,s,o;const l=hc(fc(e)),u=(n=l.apiKey)!==null&&n!==void 0?n:null,c=(r=l.oobCode)!==null&&r!==void 0?r:null,h=t7((a=l.mode)!==null&&a!==void 0?a:null);Me(u&&c&&h,"argument-error"),this.apiKey=u,this.operation=h,this.code=c,this.continueUrl=(i=l.continueUrl)!==null&&i!==void 0?i:null,this.languageCode=(s=l.languageCode)!==null&&s!==void 0?s:null,this.tenantId=(o=l.tenantId)!==null&&o!==void 0?o:null}static parseLink(e){const n=n7(e);try{return new xE(n)}catch{return null}}}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class bu{constructor(){this.providerId=bu.PROVIDER_ID}static credential(e,n){return Cd._fromEmailAndPassword(e,n)}static credentialWithLink(e,n){const r=xE.parseLink(n);return Me(r,"argument-error"),Cd._fromEmailAndCode(e,r.code,r.tenantId)}}bu.PROVIDER_ID="password";bu.EMAIL_PASSWORD_SIGN_IN_METHOD="password";bu.EMAIL_LINK_SIGN_IN_METHOD="emailLink";/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class $R{constructor(e){this.providerId=e,this.defaultLanguageCode=null,this.customParameters={}}setDefaultLanguage(e){this.defaultLanguageCode=e}setCustomParameters(e){return this.customParameters=e,this}getCustomParameters(){return this.customParameters}}/** * @license * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class uh extends $R{constructor(){super(...arguments),this.scopes=[]}addScope(e){return this.scopes.includes(e)||this.scopes.push(e),this}getScopes(){return[...this.scopes]}}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class Di extends uh{constructor(){super("facebook.com")}static credential(e){return bo._fromParams({providerId:Di.PROVIDER_ID,signInMethod:Di.FACEBOOK_SIGN_IN_METHOD,accessToken:e})}static credentialFromResult(e){return Di.credentialFromTaggedObject(e)}static credentialFromError(e){return Di.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e||!("oauthAccessToken"in e)||!e.oauthAccessToken)return null;try{return Di.credential(e.oauthAccessToken)}catch{return null}}}Di.FACEBOOK_SIGN_IN_METHOD="facebook.com";Di.PROVIDER_ID="facebook.com";/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class Fi extends uh{constructor(){super("google.com"),this.addScope("profile")}static credential(e,n){return bo._fromParams({providerId:Fi.PROVIDER_ID,signInMethod:Fi.GOOGLE_SIGN_IN_METHOD,idToken:e,accessToken:n})}static credentialFromResult(e){return Fi.credentialFromTaggedObject(e)}static credentialFromError(e){return Fi.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;const{oauthIdToken:n,oauthAccessToken:r}=e;if(!n&&!r)return null;try{return Fi.credential(n,r)}catch{return null}}}Fi.GOOGLE_SIGN_IN_METHOD="google.com";Fi.PROVIDER_ID="google.com";/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class Bi extends uh{constructor(){super("github.com")}static credential(e){return bo._fromParams({providerId:Bi.PROVIDER_ID,signInMethod:Bi.GITHUB_SIGN_IN_METHOD,accessToken:e})}static credentialFromResult(e){return Bi.credentialFromTaggedObject(e)}static credentialFromError(e){return Bi.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e||!("oauthAccessToken"in e)||!e.oauthAccessToken)return null;try{return Bi.credential(e.oauthAccessToken)}catch{return null}}}Bi.GITHUB_SIGN_IN_METHOD="github.com";Bi.PROVIDER_ID="github.com";/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class Ui extends uh{constructor(){super("twitter.com")}static credential(e,n){return bo._fromParams({providerId:Ui.PROVIDER_ID,signInMethod:Ui.TWITTER_SIGN_IN_METHOD,oauthToken:e,oauthTokenSecret:n})}static credentialFromResult(e){return Ui.credentialFromTaggedObject(e)}static credentialFromError(e){return Ui.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;const{oauthAccessToken:n,oauthTokenSecret:r}=e;if(!n||!r)return null;try{return Ui.credential(n,r)}catch{return null}}}Ui.TWITTER_SIGN_IN_METHOD="twitter.com";Ui.PROVIDER_ID="twitter.com";/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class Zl{constructor(e){this.user=e.user,this.providerId=e.providerId,this._tokenResponse=e._tokenResponse,this.operationType=e.operationType}static async _fromIdTokenResponse(e,n,r,a=!1){const i=await Ya._fromIdTokenResponse(e,r,a),s=LT(r);return new Zl({user:i,providerId:s,_tokenResponse:r,operationType:n})}static async _forOperation(e,n,r){await e._updateTokensIfNecessary(r,!0);const a=LT(r);return new Zl({user:e,providerId:a,_tokenResponse:r,operationType:n})}}function LT(t){return t.providerId?t.providerId:"phoneNumber"in t?"phone":null}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class $p extends vi{constructor(e,n,r,a){var i;super(n.code,n.message),this.operationType=r,this.user=a,Object.setPrototypeOf(this,$p.prototype),this.customData={appName:e.name,tenantId:(i=e.tenantId)!==null&&i!==void 0?i:void 0,_serverResponse:n.customData._serverResponse,operationType:r}}static _fromErrorAndOperation(e,n,r,a){return new $p(e,n,r,a)}}function KR(t,e,n,r){return(e==="reauthenticate"?n._getReauthenticationResolver(t):n._getIdTokenResponse(t)).catch(i=>{throw i.code==="auth/multi-factor-auth-required"?$p._fromErrorAndOperation(t,i,e,r):i})}async function r7(t,e,n=!1){const r=await wd(t,e._linkToIdToken(t.auth,await t.getIdToken()),n);return Zl._forOperation(t,"link",r)}/** * @license * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */async function a7(t,e,n=!1){const{auth:r}=t;if($a(r.app))return Promise.reject(ls(r));const a="reauthenticate";try{const i=await wd(t,KR(r,a,e,t),n);Me(i.idToken,r,"internal-error");const s=yE(i.idToken);Me(s,r,"internal-error");const{sub:o}=s;return Me(t.uid===o,r,"user-mismatch"),Zl._forOperation(t,a,i)}catch(i){throw(i==null?void 0:i.code)==="auth/user-not-found"&&ua(r,"user-mismatch"),i}}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */async function JR(t,e,n=!1){if($a(t.app))return Promise.reject(ls(t));const r="signIn",a=await KR(t,r,e),i=await Zl._fromIdTokenResponse(t,r,a);return n||await t._updateCurrentUser(i.user),i}async function i7(t,e){return JR(Eu(t),e)}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */async function s7(t){const e=Eu(t);e._getPasswordPolicyInternal()&&await e._updatePasswordPolicy()}function o7(t,e,n){return $a(t.app)?Promise.reject(ls(t)):i7(pn(t),bu.credential(e,n)).catch(async r=>{throw r.code==="auth/password-does-not-meet-requirements"&&s7(t),r})}function l7(t,e,n,r){return pn(t).onIdTokenChanged(e,n,r)}function u7(t,e,n){return pn(t).beforeAuthStateChanged(e,n)}function c7(t,e,n,r){return pn(t).onAuthStateChanged(e,n,r)}function d7(t){return pn(t).signOut()}const Kp="__sak";/** * @license * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class YR{constructor(e,n){this.storageRetriever=e,this.type=n}_isAvailable(){try{return this.storage?(this.storage.setItem(Kp,"1"),this.storage.removeItem(Kp),Promise.resolve(!0)):Promise.resolve(!1)}catch{return Promise.resolve(!1)}}_set(e,n){return this.storage.setItem(e,JSON.stringify(n)),Promise.resolve()}_get(e){const n=this.storage.getItem(e);return Promise.resolve(n?JSON.parse(n):null)}_remove(e){return this.storage.removeItem(e),Promise.resolve()}get storage(){return this.storageRetriever()}}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const h7=1e3,f7=10;class XR extends YR{constructor(){super(()=>window.localStorage,"LOCAL"),this.boundEventHandler=(e,n)=>this.onStorageEvent(e,n),this.listeners={},this.localCache={},this.pollTimer=null,this.fallbackToPolling=qR(),this._shouldAllowMigration=!0}forAllChangedKeys(e){for(const n of Object.keys(this.listeners)){const r=this.storage.getItem(n),a=this.localCache[n];r!==a&&e(n,a,r)}}onStorageEvent(e,n=!1){if(!e.key){this.forAllChangedKeys((s,o,l)=>{this.notifyListeners(s,l)});return}const r=e.key;n?this.detachListener():this.stopPolling();const a=()=>{const s=this.storage.getItem(r);!n&&this.localCache[r]===s||this.notifyListeners(r,s)},i=this.storage.getItem(r);N9()&&i!==e.newValue&&e.newValue!==e.oldValue?setTimeout(a,f7):a()}notifyListeners(e,n){this.localCache[e]=n;const r=this.listeners[e];if(r)for(const a of Array.from(r))a(n&&JSON.parse(n))}startPolling(){this.stopPolling(),this.pollTimer=setInterval(()=>{this.forAllChangedKeys((e,n,r)=>{this.onStorageEvent(new StorageEvent("storage",{key:e,oldValue:n,newValue:r}),!0)})},h7)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}attachListener(){window.addEventListener("storage",this.boundEventHandler)}detachListener(){window.removeEventListener("storage",this.boundEventHandler)}_addListener(e,n){Object.keys(this.listeners).length===0&&(this.fallbackToPolling?this.startPolling():this.attachListener()),this.listeners[e]||(this.listeners[e]=new Set,this.localCache[e]=this.storage.getItem(e)),this.listeners[e].add(n)}_removeListener(e,n){this.listeners[e]&&(this.listeners[e].delete(n),this.listeners[e].size===0&&delete this.listeners[e]),Object.keys(this.listeners).length===0&&(this.detachListener(),this.stopPolling())}async _set(e,n){await super._set(e,n),this.localCache[e]=JSON.stringify(n)}async _get(e){const n=await super._get(e);return this.localCache[e]=JSON.stringify(n),n}async _remove(e){await super._remove(e),delete this.localCache[e]}}XR.type="LOCAL";const p7=XR;/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class QR extends YR{constructor(){super(()=>window.sessionStorage,"SESSION")}_addListener(e,n){}_removeListener(e,n){}}QR.type="SESSION";const ZR=QR;/** * @license * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function m7(t){return Promise.all(t.map(async e=>{try{return{fulfilled:!0,value:await e}}catch(n){return{fulfilled:!1,reason:n}}}))}/** * @license * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class lm{constructor(e){this.eventTarget=e,this.handlersMap={},this.boundEventHandler=this.handleEvent.bind(this)}static _getInstance(e){const n=this.receivers.find(a=>a.isListeningto(e));if(n)return n;const r=new lm(e);return this.receivers.push(r),r}isListeningto(e){return this.eventTarget===e}async handleEvent(e){const n=e,{eventId:r,eventType:a,data:i}=n.data,s=this.handlersMap[a];if(!(s!=null&&s.size))return;n.ports[0].postMessage({status:"ack",eventId:r,eventType:a});const o=Array.from(s).map(async u=>u(n.origin,i)),l=await m7(o);n.ports[0].postMessage({status:"done",eventId:r,eventType:a,response:l})}_subscribe(e,n){Object.keys(this.handlersMap).length===0&&this.eventTarget.addEventListener("message",this.boundEventHandler),this.handlersMap[e]||(this.handlersMap[e]=new Set),this.handlersMap[e].add(n)}_unsubscribe(e,n){this.handlersMap[e]&&n&&this.handlersMap[e].delete(n),(!n||this.handlersMap[e].size===0)&&delete this.handlersMap[e],Object.keys(this.handlersMap).length===0&&this.eventTarget.removeEventListener("message",this.boundEventHandler)}}lm.receivers=[];/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function SE(t="",e=10){let n="";for(let r=0;r{const u=SE("",20);a.port1.start();const c=setTimeout(()=>{l(new Error("unsupported_event"))},r);s={messageChannel:a,onMessage(h){const f=h;if(f.data.eventId===u)switch(f.data.status){case"ack":clearTimeout(c),i=setTimeout(()=>{l(new Error("timeout"))},3e3);break;case"done":clearTimeout(i),o(f.data.response);break;default:clearTimeout(c),clearTimeout(i),l(new Error("invalid_response"));break}}},this.handlers.add(s),a.port1.addEventListener("message",s.onMessage),this.target.postMessage({eventType:e,eventId:u,data:n},[a.port2])}).finally(()=>{s&&this.removeMessageHandler(s)})}}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function Ia(){return window}function v7(t){Ia().location.href=t}/** * @license * Copyright 2020 Google LLC. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function e4(){return typeof Ia().WorkerGlobalScope<"u"&&typeof Ia().importScripts=="function"}async function _7(){if(!(navigator!=null&&navigator.serviceWorker))return null;try{return(await navigator.serviceWorker.ready).active}catch{return null}}function y7(){var t;return((t=navigator==null?void 0:navigator.serviceWorker)===null||t===void 0?void 0:t.controller)||null}function E7(){return e4()?self:null}/** * @license * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const t4="firebaseLocalStorageDb",b7=1,Jp="firebaseLocalStorage",n4="fbase_key";class ch{constructor(e){this.request=e}toPromise(){return new Promise((e,n)=>{this.request.addEventListener("success",()=>{e(this.request.result)}),this.request.addEventListener("error",()=>{n(this.request.error)})})}}function um(t,e){return t.transaction([Jp],e?"readwrite":"readonly").objectStore(Jp)}function x7(){const t=indexedDB.deleteDatabase(t4);return new ch(t).toPromise()}function F1(){const t=indexedDB.open(t4,b7);return new Promise((e,n)=>{t.addEventListener("error",()=>{n(t.error)}),t.addEventListener("upgradeneeded",()=>{const r=t.result;try{r.createObjectStore(Jp,{keyPath:n4})}catch(a){n(a)}}),t.addEventListener("success",async()=>{const r=t.result;r.objectStoreNames.contains(Jp)?e(r):(r.close(),await x7(),e(await F1()))})})}async function DT(t,e,n){const r=um(t,!0).put({[n4]:e,value:n});return new ch(r).toPromise()}async function S7(t,e){const n=um(t,!1).get(e),r=await new ch(n).toPromise();return r===void 0?null:r.value}function FT(t,e){const n=um(t,!0).delete(e);return new ch(n).toPromise()}const T7=800,w7=3;class r4{constructor(){this.type="LOCAL",this._shouldAllowMigration=!0,this.listeners={},this.localCache={},this.pollTimer=null,this.pendingWrites=0,this.receiver=null,this.sender=null,this.serviceWorkerReceiverAvailable=!1,this.activeServiceWorker=null,this._workerInitializationPromise=this.initializeServiceWorkerMessaging().then(()=>{},()=>{})}async _openDb(){return this.db?this.db:(this.db=await F1(),this.db)}async _withRetries(e){let n=0;for(;;)try{const r=await this._openDb();return await e(r)}catch(r){if(n++>w7)throw r;this.db&&(this.db.close(),this.db=void 0)}}async initializeServiceWorkerMessaging(){return e4()?this.initializeReceiver():this.initializeSender()}async initializeReceiver(){this.receiver=lm._getInstance(E7()),this.receiver._subscribe("keyChanged",async(e,n)=>({keyProcessed:(await this._poll()).includes(n.key)})),this.receiver._subscribe("ping",async(e,n)=>["keyChanged"])}async initializeSender(){var e,n;if(this.activeServiceWorker=await _7(),!this.activeServiceWorker)return;this.sender=new g7(this.activeServiceWorker);const r=await this.sender._send("ping",{},800);r&&!((e=r[0])===null||e===void 0)&&e.fulfilled&&!((n=r[0])===null||n===void 0)&&n.value.includes("keyChanged")&&(this.serviceWorkerReceiverAvailable=!0)}async notifyServiceWorker(e){if(!(!this.sender||!this.activeServiceWorker||y7()!==this.activeServiceWorker))try{await this.sender._send("keyChanged",{key:e},this.serviceWorkerReceiverAvailable?800:50)}catch{}}async _isAvailable(){try{if(!indexedDB)return!1;const e=await F1();return await DT(e,Kp,"1"),await FT(e,Kp),!0}catch{}return!1}async _withPendingWrite(e){this.pendingWrites++;try{await e()}finally{this.pendingWrites--}}async _set(e,n){return this._withPendingWrite(async()=>(await this._withRetries(r=>DT(r,e,n)),this.localCache[e]=n,this.notifyServiceWorker(e)))}async _get(e){const n=await this._withRetries(r=>S7(r,e));return this.localCache[e]=n,n}async _remove(e){return this._withPendingWrite(async()=>(await this._withRetries(n=>FT(n,e)),delete this.localCache[e],this.notifyServiceWorker(e)))}async _poll(){const e=await this._withRetries(a=>{const i=um(a,!1).getAll();return new ch(i).toPromise()});if(!e)return[];if(this.pendingWrites!==0)return[];const n=[],r=new Set;if(e.length!==0)for(const{fbase_key:a,value:i}of e)r.add(a),JSON.stringify(this.localCache[a])!==JSON.stringify(i)&&(this.notifyListeners(a,i),n.push(a));for(const a of Object.keys(this.localCache))this.localCache[a]&&!r.has(a)&&(this.notifyListeners(a,null),n.push(a));return n}notifyListeners(e,n){this.localCache[e]=n;const r=this.listeners[e];if(r)for(const a of Array.from(r))a(n)}startPolling(){this.stopPolling(),this.pollTimer=setInterval(async()=>this._poll(),T7)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}_addListener(e,n){Object.keys(this.listeners).length===0&&this.startPolling(),this.listeners[e]||(this.listeners[e]=new Set,this._get(e)),this.listeners[e].add(n)}_removeListener(e,n){this.listeners[e]&&(this.listeners[e].delete(n),this.listeners[e].size===0&&delete this.listeners[e]),Object.keys(this.listeners).length===0&&this.stopPolling()}}r4.type="LOCAL";const C7=r4;new lh(3e4,6e4);/** * @license * Copyright 2021 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function A7(t,e){return e?Xa(e):(Me(t._popupRedirectResolver,t,"argument-error"),t._popupRedirectResolver)}/** * @license * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class TE extends bE{constructor(e){super("custom","custom"),this.params=e}_getIdTokenResponse(e){return Ol(e,this._buildIdpRequest())}_linkToIdToken(e,n){return Ol(e,this._buildIdpRequest(n))}_getReauthenticationResolver(e){return Ol(e,this._buildIdpRequest())}_buildIdpRequest(e){const n={requestUri:this.params.requestUri,sessionId:this.params.sessionId,postBody:this.params.postBody,tenantId:this.params.tenantId,pendingToken:this.params.pendingToken,returnSecureToken:!0,returnIdpCredential:!0};return e&&(n.idToken=e),n}}function I7(t){return JR(t.auth,new TE(t),t.bypassAuthState)}function P7(t){const{auth:e,user:n}=t;return Me(n,e,"internal-error"),a7(n,new TE(t),t.bypassAuthState)}async function R7(t){const{auth:e,user:n}=t;return Me(n,e,"internal-error"),r7(n,new TE(t),t.bypassAuthState)}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class a4{constructor(e,n,r,a,i=!1){this.auth=e,this.resolver=r,this.user=a,this.bypassAuthState=i,this.pendingPromise=null,this.eventManager=null,this.filter=Array.isArray(n)?n:[n]}execute(){return new Promise(async(e,n)=>{this.pendingPromise={resolve:e,reject:n};try{this.eventManager=await this.resolver._initialize(this.auth),await this.onExecution(),this.eventManager.registerConsumer(this)}catch(r){this.reject(r)}})}async onAuthEvent(e){const{urlResponse:n,sessionId:r,postBody:a,tenantId:i,error:s,type:o}=e;if(s){this.reject(s);return}const l={auth:this.auth,requestUri:n,sessionId:r,tenantId:i||void 0,postBody:a||void 0,user:this.user,bypassAuthState:this.bypassAuthState};try{this.resolve(await this.getIdpTask(o)(l))}catch(u){this.reject(u)}}onError(e){this.reject(e)}getIdpTask(e){switch(e){case"signInViaPopup":case"signInViaRedirect":return I7;case"linkViaPopup":case"linkViaRedirect":return R7;case"reauthViaPopup":case"reauthViaRedirect":return P7;default:ua(this.auth,"internal-error")}}resolve(e){ci(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.resolve(e),this.unregisterAndCleanUp()}reject(e){ci(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.reject(e),this.unregisterAndCleanUp()}unregisterAndCleanUp(){this.eventManager&&this.eventManager.unregisterConsumer(this),this.pendingPromise=null,this.cleanUp()}}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const k7=new lh(2e3,1e4);class yl extends a4{constructor(e,n,r,a,i){super(e,n,a,i),this.provider=r,this.authWindow=null,this.pollId=null,yl.currentPopupAction&&yl.currentPopupAction.cancel(),yl.currentPopupAction=this}async executeNotNull(){const e=await this.execute();return Me(e,this.auth,"internal-error"),e}async onExecution(){ci(this.filter.length===1,"Popup operations only handle one event");const e=SE();this.authWindow=await this.resolver._openPopup(this.auth,this.provider,this.filter[0],e),this.authWindow.associatedEvent=e,this.resolver._originValidation(this.auth).catch(n=>{this.reject(n)}),this.resolver._isIframeWebStorageSupported(this.auth,n=>{n||this.reject(Aa(this.auth,"web-storage-unsupported"))}),this.pollUserCancellation()}get eventId(){var e;return((e=this.authWindow)===null||e===void 0?void 0:e.associatedEvent)||null}cancel(){this.reject(Aa(this.auth,"cancelled-popup-request"))}cleanUp(){this.authWindow&&this.authWindow.close(),this.pollId&&window.clearTimeout(this.pollId),this.authWindow=null,this.pollId=null,yl.currentPopupAction=null}pollUserCancellation(){const e=()=>{var n,r;if(!((r=(n=this.authWindow)===null||n===void 0?void 0:n.window)===null||r===void 0)&&r.closed){this.pollId=window.setTimeout(()=>{this.pollId=null,this.reject(Aa(this.auth,"popup-closed-by-user"))},8e3);return}this.pollId=window.setTimeout(e,k7.get())};e()}}yl.currentPopupAction=null;/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const N7="pendingRedirect",Gf=new Map;class O7 extends a4{constructor(e,n,r=!1){super(e,["signInViaRedirect","linkViaRedirect","reauthViaRedirect","unknown"],n,void 0,r),this.eventId=null}async execute(){let e=Gf.get(this.auth._key());if(!e){try{const r=await M7(this.resolver,this.auth)?await super.execute():null;e=()=>Promise.resolve(r)}catch(n){e=()=>Promise.reject(n)}Gf.set(this.auth._key(),e)}return this.bypassAuthState||Gf.set(this.auth._key(),()=>Promise.resolve(null)),e()}async onAuthEvent(e){if(e.type==="signInViaRedirect")return super.onAuthEvent(e);if(e.type==="unknown"){this.resolve(null);return}if(e.eventId){const n=await this.auth._redirectUserForId(e.eventId);if(n)return this.user=n,super.onAuthEvent(e);this.resolve(null)}}async onExecution(){}cleanUp(){}}async function M7(t,e){const n=F7(e),r=D7(t);if(!await r._isAvailable())return!1;const a=await r._get(n)==="true";return await r._remove(n),a}function L7(t,e){Gf.set(t._key(),e)}function D7(t){return Xa(t._redirectPersistence)}function F7(t){return qf(N7,t.config.apiKey,t.name)}async function B7(t,e,n=!1){if($a(t.app))return Promise.reject(ls(t));const r=Eu(t),a=A7(r,e),s=await new O7(r,a,n).execute();return s&&!n&&(delete s.user._redirectEventId,await r._persistUserIfCurrent(s.user),await r._setRedirectUser(null,e)),s}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const U7=10*60*1e3;class V7{constructor(e){this.auth=e,this.cachedEventUids=new Set,this.consumers=new Set,this.queuedRedirectEvent=null,this.hasHandledPotentialRedirect=!1,this.lastProcessedEventTime=Date.now()}registerConsumer(e){this.consumers.add(e),this.queuedRedirectEvent&&this.isEventForConsumer(this.queuedRedirectEvent,e)&&(this.sendToConsumer(this.queuedRedirectEvent,e),this.saveEventToCache(this.queuedRedirectEvent),this.queuedRedirectEvent=null)}unregisterConsumer(e){this.consumers.delete(e)}onEvent(e){if(this.hasEventBeenHandled(e))return!1;let n=!1;return this.consumers.forEach(r=>{this.isEventForConsumer(e,r)&&(n=!0,this.sendToConsumer(e,r),this.saveEventToCache(e))}),this.hasHandledPotentialRedirect||!j7(e)||(this.hasHandledPotentialRedirect=!0,n||(this.queuedRedirectEvent=e,n=!0)),n}sendToConsumer(e,n){var r;if(e.error&&!i4(e)){const a=((r=e.error.code)===null||r===void 0?void 0:r.split("auth/")[1])||"internal-error";n.onError(Aa(this.auth,a))}else n.onAuthEvent(e)}isEventForConsumer(e,n){const r=n.eventId===null||!!e.eventId&&e.eventId===n.eventId;return n.filter.includes(e.type)&&r}hasEventBeenHandled(e){return Date.now()-this.lastProcessedEventTime>=U7&&this.cachedEventUids.clear(),this.cachedEventUids.has(BT(e))}saveEventToCache(e){this.cachedEventUids.add(BT(e)),this.lastProcessedEventTime=Date.now()}}function BT(t){return[t.type,t.eventId,t.sessionId,t.tenantId].filter(e=>e).join("-")}function i4({type:t,error:e}){return t==="unknown"&&(e==null?void 0:e.code)==="auth/no-auth-event"}function j7(t){switch(t.type){case"signInViaRedirect":case"linkViaRedirect":case"reauthViaRedirect":return!0;case"unknown":return i4(t);default:return!1}}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */async function z7(t,e={}){return Ps(t,"GET","/v1/projects",e)}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const q7=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,G7=/^https?/;async function H7(t){if(t.config.emulator)return;const{authorizedDomains:e}=await z7(t);for(const n of e)try{if(W7(n))return}catch{}ua(t,"unauthorized-domain")}function W7(t){const e=L1(),{protocol:n,hostname:r}=new URL(e);if(t.startsWith("chrome-extension://")){const s=new URL(t);return s.hostname===""&&r===""?n==="chrome-extension:"&&t.replace("chrome-extension://","")===e.replace("chrome-extension://",""):n==="chrome-extension:"&&s.hostname===r}if(!G7.test(n))return!1;if(q7.test(t))return r===t;const a=t.replace(/\./g,"\\.");return new RegExp("^(.+\\."+a+"|"+a+")$","i").test(r)}/** * @license * Copyright 2020 Google LLC. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const $7=new lh(3e4,6e4);function UT(){const t=Ia().___jsl;if(t!=null&&t.H){for(const e of Object.keys(t.H))if(t.H[e].r=t.H[e].r||[],t.H[e].L=t.H[e].L||[],t.H[e].r=[...t.H[e].L],t.CP)for(let n=0;n{var r,a,i;function s(){UT(),gapi.load("gapi.iframes",{callback:()=>{e(gapi.iframes.getContext())},ontimeout:()=>{UT(),n(Aa(t,"network-request-failed"))},timeout:$7.get()})}if(!((a=(r=Ia().gapi)===null||r===void 0?void 0:r.iframes)===null||a===void 0)&&a.Iframe)e(gapi.iframes.getContext());else if(!((i=Ia().gapi)===null||i===void 0)&&i.load)s();else{const o=j9("iframefcb");return Ia()[o]=()=>{gapi.load?s():n(Aa(t,"network-request-failed"))},HR(`${V9()}?onload=${o}`).catch(l=>n(l))}}).catch(e=>{throw Hf=null,e})}let Hf=null;function J7(t){return Hf=Hf||K7(t),Hf}/** * @license * Copyright 2020 Google LLC. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const Y7=new lh(5e3,15e3),X7="__/auth/iframe",Q7="emulator/auth/iframe",Z7={style:{position:"absolute",top:"-100px",width:"1px",height:"1px"},"aria-hidden":"true",tabindex:"-1"},eU=new Map([["identitytoolkit.googleapis.com","p"],["staging-identitytoolkit.sandbox.googleapis.com","s"],["test-identitytoolkit.sandbox.googleapis.com","t"]]);function tU(t){const e=t.config;Me(e.authDomain,t,"auth-domain-config-required");const n=e.emulator?_E(e,Q7):`https://${t.config.authDomain}/${X7}`,r={apiKey:e.apiKey,appName:t.name,v:Lo},a=eU.get(t.config.apiHost);a&&(r.eid=a);const i=t._getFrameworks();return i.length&&(r.fw=i.join(",")),`${n}?${mu(r).slice(1)}`}async function nU(t){const e=await J7(t),n=Ia().gapi;return Me(n,t,"internal-error"),e.open({where:document.body,url:tU(t),messageHandlersFilter:n.iframes.CROSS_ORIGIN_IFRAMES_FILTER,attributes:Z7,dontclear:!0},r=>new Promise(async(a,i)=>{await r.restyle({setHideOnLeave:!1});const s=Aa(t,"network-request-failed"),o=Ia().setTimeout(()=>{i(s)},Y7.get());function l(){Ia().clearTimeout(o),a(r)}r.ping(l).then(l,()=>{i(s)})}))}/** * @license * Copyright 2020 Google LLC. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const rU={location:"yes",resizable:"yes",statusbar:"yes",toolbar:"no"},aU=500,iU=600,sU="_blank",oU="http://localhost";class VT{constructor(e){this.window=e,this.associatedEvent=null}close(){if(this.window)try{this.window.close()}catch{}}}function lU(t,e,n,r=aU,a=iU){const i=Math.max((window.screen.availHeight-a)/2,0).toString(),s=Math.max((window.screen.availWidth-r)/2,0).toString();let o="";const l=Object.assign(Object.assign({},rU),{width:r.toString(),height:a.toString(),top:i,left:s}),u=zn().toLowerCase();n&&(o=BR(u)?sU:n),DR(u)&&(e=e||oU,l.scrollbars="yes");const c=Object.entries(l).reduce((f,[p,g])=>`${f}${p}=${g},`,"");if(k9(u)&&o!=="_self")return uU(e||"",o),new VT(null);const h=window.open(e||"",o,c);Me(h,t,"popup-blocked");try{h.focus()}catch{}return new VT(h)}function uU(t,e){const n=document.createElement("a");n.href=t,n.target=e;const r=document.createEvent("MouseEvent");r.initMouseEvent("click",!0,!0,window,1,0,0,0,0,!1,!1,!1,!1,1,null),n.dispatchEvent(r)}/** * @license * Copyright 2021 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const cU="__/auth/handler",dU="emulator/auth/handler",hU=encodeURIComponent("fac");async function jT(t,e,n,r,a,i){Me(t.config.authDomain,t,"auth-domain-config-required"),Me(t.config.apiKey,t,"invalid-api-key");const s={apiKey:t.config.apiKey,appName:t.name,authType:n,redirectUrl:r,v:Lo,eventId:a};if(e instanceof $R){e.setDefaultLanguage(t.languageCode),s.providerId=e.providerId||"",y1(e.getCustomParameters())||(s.customParameters=JSON.stringify(e.getCustomParameters()));for(const[c,h]of Object.entries({}))s[c]=h}if(e instanceof uh){const c=e.getScopes().filter(h=>h!=="");c.length>0&&(s.scopes=c.join(","))}t.tenantId&&(s.tid=t.tenantId);const o=s;for(const c of Object.keys(o))o[c]===void 0&&delete o[c];const l=await t._getAppCheckToken(),u=l?`#${hU}=${encodeURIComponent(l)}`:"";return`${fU(t)}?${mu(o).slice(1)}${u}`}function fU({config:t}){return t.emulator?_E(t,dU):`https://${t.authDomain}/${cU}`}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const jg="webStorageSupport";class pU{constructor(){this.eventManagers={},this.iframes={},this.originValidationPromises={},this._redirectPersistence=ZR,this._completeRedirectFn=B7,this._overrideRedirectResult=L7}async _openPopup(e,n,r,a){var i;ci((i=this.eventManagers[e._key()])===null||i===void 0?void 0:i.manager,"_initialize() not called before _openPopup()");const s=await jT(e,n,r,L1(),a);return lU(e,s,SE())}async _openRedirect(e,n,r,a){await this._originValidation(e);const i=await jT(e,n,r,L1(),a);return v7(i),new Promise(()=>{})}_initialize(e){const n=e._key();if(this.eventManagers[n]){const{manager:a,promise:i}=this.eventManagers[n];return a?Promise.resolve(a):(ci(i,"If manager is not set, promise should be"),i)}const r=this.initAndGetManager(e);return this.eventManagers[n]={promise:r},r.catch(()=>{delete this.eventManagers[n]}),r}async initAndGetManager(e){const n=await nU(e),r=new V7(e);return n.register("authEvent",a=>(Me(a==null?void 0:a.authEvent,e,"invalid-auth-event"),{status:r.onEvent(a.authEvent)?"ACK":"ERROR"}),gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER),this.eventManagers[e._key()]={manager:r},this.iframes[e._key()]=n,r}_isIframeWebStorageSupported(e,n){this.iframes[e._key()].send(jg,{type:jg},a=>{var i;const s=(i=a==null?void 0:a[0])===null||i===void 0?void 0:i[jg];s!==void 0&&n(!!s),ua(e,"internal-error")},gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER)}_originValidation(e){const n=e._key();return this.originValidationPromises[n]||(this.originValidationPromises[n]=H7(e)),this.originValidationPromises[n]}get _shouldInitProactively(){return qR()||FR()||EE()}}const mU=pU;var zT="@firebase/auth",qT="1.7.7";/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class gU{constructor(e){this.auth=e,this.internalListeners=new Map}getUid(){var e;return this.assertAuthConfigured(),((e=this.auth.currentUser)===null||e===void 0?void 0:e.uid)||null}async getToken(e){return this.assertAuthConfigured(),await this.auth._initializationPromise,this.auth.currentUser?{accessToken:await this.auth.currentUser.getIdToken(e)}:null}addAuthTokenListener(e){if(this.assertAuthConfigured(),this.internalListeners.has(e))return;const n=this.auth.onIdTokenChanged(r=>{e((r==null?void 0:r.stsTokenManager.accessToken)||null)});this.internalListeners.set(e,n),this.updateProactiveRefresh()}removeAuthTokenListener(e){this.assertAuthConfigured();const n=this.internalListeners.get(e);n&&(this.internalListeners.delete(e),n(),this.updateProactiveRefresh())}assertAuthConfigured(){Me(this.auth._initializationPromise,"dependent-sdk-initialized-before-auth")}updateProactiveRefresh(){this.internalListeners.size>0?this.auth._startProactiveRefresh():this.auth._stopProactiveRefresh()}}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function vU(t){switch(t){case"Node":return"node";case"ReactNative":return"rn";case"Worker":return"webworker";case"Cordova":return"cordova";case"WebExtension":return"web-extension";default:return}}function _U(t){vo(new ds("auth",(e,{options:n})=>{const r=e.getProvider("app").getImmediate(),a=e.getProvider("heartbeat"),i=e.getProvider("app-check-internal"),{apiKey:s,authDomain:o}=r.options;Me(s&&!s.includes(":"),"invalid-api-key",{appName:r.name});const l={apiKey:s,authDomain:o,clientPlatform:t,apiHost:"identitytoolkit.googleapis.com",tokenApiHost:"securetoken.googleapis.com",apiScheme:"https",sdkClientVersion:GR(t)},u=new F9(r,a,i,l);return W9(u,n),u},"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((e,n,r)=>{e.getProvider("auth-internal").initialize()})),vo(new ds("auth-internal",e=>{const n=Eu(e.getProvider("auth").getImmediate());return(r=>new gU(r))(n)},"PRIVATE").setInstantiationMode("EXPLICIT")),Ca(zT,qT,vU(t)),Ca(zT,qT,"esm2017")}/** * @license * Copyright 2021 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const yU=5*60,EU=XI("authIdTokenMaxAge")||yU;let GT=null;const bU=t=>async e=>{const n=e&&await e.getIdTokenResult(),r=n&&(new Date().getTime()-Date.parse(n.issuedAtTime))/1e3;if(r&&r>EU)return;const a=n==null?void 0:n.token;GT!==a&&(GT=a,await fetch(t,{method:a?"POST":"DELETE",headers:a?{Authorization:`Bearer ${a}`}:{}}))};function xU(t=Oy()){const e=J0(t,"auth");if(e.isInitialized())return e.getImmediate();const n=H9(t,{popupRedirectResolver:mU,persistence:[C7,p7,ZR]}),r=XI("authTokenSyncURL");if(r&&typeof isSecureContext=="boolean"&&isSecureContext){const i=new URL(r,location.origin);if(location.origin===i.origin){const s=bU(i.toString());u7(n,s,()=>s(n.currentUser)),l7(n,o=>s(o))}}const a=KI("auth");return a&&$9(n,`http://${a}`),n}function SU(){var t,e;return(e=(t=document.getElementsByTagName("head"))===null||t===void 0?void 0:t[0])!==null&&e!==void 0?e:document}B9({loadJS(t){return new Promise((e,n)=>{const r=document.createElement("script");r.setAttribute("src",t),r.onload=e,r.onerror=a=>{const i=Aa("internal-error");i.customData=a,n(i)},r.type="text/javascript",r.charset="UTF-8",SU().appendChild(r)})},gapiScript:"https://apis.google.com/js/api.js",recaptchaV2Script:"https://www.google.com/recaptcha/api.js",recaptchaEnterpriseScript:"https://www.google.com/recaptcha/enterprise.js?render="});_U("Browser");var HT=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};/** @license Copyright The Closure Library Authors. SPDX-License-Identifier: Apache-2.0 */var ro,s4;(function(){var t;/** @license Copyright The Closure Library Authors. SPDX-License-Identifier: Apache-2.0 */function e(T,S){function w(){}w.prototype=S.prototype,T.D=S.prototype,T.prototype=new w,T.prototype.constructor=T,T.C=function(A,R,L){for(var N=Array(arguments.length-2),Re=2;ReR;++R)A[R]=S.charCodeAt(w++)|S.charCodeAt(w++)<<8|S.charCodeAt(w++)<<16|S.charCodeAt(w++)<<24;else for(R=0;16>R;++R)A[R]=S[w++]|S[w++]<<8|S[w++]<<16|S[w++]<<24;S=T.g[0],w=T.g[1],R=T.g[2];var L=T.g[3],N=S+(L^w&(R^L))+A[0]+3614090360&4294967295;S=w+(N<<7&4294967295|N>>>25),N=L+(R^S&(w^R))+A[1]+3905402710&4294967295,L=S+(N<<12&4294967295|N>>>20),N=R+(w^L&(S^w))+A[2]+606105819&4294967295,R=L+(N<<17&4294967295|N>>>15),N=w+(S^R&(L^S))+A[3]+3250441966&4294967295,w=R+(N<<22&4294967295|N>>>10),N=S+(L^w&(R^L))+A[4]+4118548399&4294967295,S=w+(N<<7&4294967295|N>>>25),N=L+(R^S&(w^R))+A[5]+1200080426&4294967295,L=S+(N<<12&4294967295|N>>>20),N=R+(w^L&(S^w))+A[6]+2821735955&4294967295,R=L+(N<<17&4294967295|N>>>15),N=w+(S^R&(L^S))+A[7]+4249261313&4294967295,w=R+(N<<22&4294967295|N>>>10),N=S+(L^w&(R^L))+A[8]+1770035416&4294967295,S=w+(N<<7&4294967295|N>>>25),N=L+(R^S&(w^R))+A[9]+2336552879&4294967295,L=S+(N<<12&4294967295|N>>>20),N=R+(w^L&(S^w))+A[10]+4294925233&4294967295,R=L+(N<<17&4294967295|N>>>15),N=w+(S^R&(L^S))+A[11]+2304563134&4294967295,w=R+(N<<22&4294967295|N>>>10),N=S+(L^w&(R^L))+A[12]+1804603682&4294967295,S=w+(N<<7&4294967295|N>>>25),N=L+(R^S&(w^R))+A[13]+4254626195&4294967295,L=S+(N<<12&4294967295|N>>>20),N=R+(w^L&(S^w))+A[14]+2792965006&4294967295,R=L+(N<<17&4294967295|N>>>15),N=w+(S^R&(L^S))+A[15]+1236535329&4294967295,w=R+(N<<22&4294967295|N>>>10),N=S+(R^L&(w^R))+A[1]+4129170786&4294967295,S=w+(N<<5&4294967295|N>>>27),N=L+(w^R&(S^w))+A[6]+3225465664&4294967295,L=S+(N<<9&4294967295|N>>>23),N=R+(S^w&(L^S))+A[11]+643717713&4294967295,R=L+(N<<14&4294967295|N>>>18),N=w+(L^S&(R^L))+A[0]+3921069994&4294967295,w=R+(N<<20&4294967295|N>>>12),N=S+(R^L&(w^R))+A[5]+3593408605&4294967295,S=w+(N<<5&4294967295|N>>>27),N=L+(w^R&(S^w))+A[10]+38016083&4294967295,L=S+(N<<9&4294967295|N>>>23),N=R+(S^w&(L^S))+A[15]+3634488961&4294967295,R=L+(N<<14&4294967295|N>>>18),N=w+(L^S&(R^L))+A[4]+3889429448&4294967295,w=R+(N<<20&4294967295|N>>>12),N=S+(R^L&(w^R))+A[9]+568446438&4294967295,S=w+(N<<5&4294967295|N>>>27),N=L+(w^R&(S^w))+A[14]+3275163606&4294967295,L=S+(N<<9&4294967295|N>>>23),N=R+(S^w&(L^S))+A[3]+4107603335&4294967295,R=L+(N<<14&4294967295|N>>>18),N=w+(L^S&(R^L))+A[8]+1163531501&4294967295,w=R+(N<<20&4294967295|N>>>12),N=S+(R^L&(w^R))+A[13]+2850285829&4294967295,S=w+(N<<5&4294967295|N>>>27),N=L+(w^R&(S^w))+A[2]+4243563512&4294967295,L=S+(N<<9&4294967295|N>>>23),N=R+(S^w&(L^S))+A[7]+1735328473&4294967295,R=L+(N<<14&4294967295|N>>>18),N=w+(L^S&(R^L))+A[12]+2368359562&4294967295,w=R+(N<<20&4294967295|N>>>12),N=S+(w^R^L)+A[5]+4294588738&4294967295,S=w+(N<<4&4294967295|N>>>28),N=L+(S^w^R)+A[8]+2272392833&4294967295,L=S+(N<<11&4294967295|N>>>21),N=R+(L^S^w)+A[11]+1839030562&4294967295,R=L+(N<<16&4294967295|N>>>16),N=w+(R^L^S)+A[14]+4259657740&4294967295,w=R+(N<<23&4294967295|N>>>9),N=S+(w^R^L)+A[1]+2763975236&4294967295,S=w+(N<<4&4294967295|N>>>28),N=L+(S^w^R)+A[4]+1272893353&4294967295,L=S+(N<<11&4294967295|N>>>21),N=R+(L^S^w)+A[7]+4139469664&4294967295,R=L+(N<<16&4294967295|N>>>16),N=w+(R^L^S)+A[10]+3200236656&4294967295,w=R+(N<<23&4294967295|N>>>9),N=S+(w^R^L)+A[13]+681279174&4294967295,S=w+(N<<4&4294967295|N>>>28),N=L+(S^w^R)+A[0]+3936430074&4294967295,L=S+(N<<11&4294967295|N>>>21),N=R+(L^S^w)+A[3]+3572445317&4294967295,R=L+(N<<16&4294967295|N>>>16),N=w+(R^L^S)+A[6]+76029189&4294967295,w=R+(N<<23&4294967295|N>>>9),N=S+(w^R^L)+A[9]+3654602809&4294967295,S=w+(N<<4&4294967295|N>>>28),N=L+(S^w^R)+A[12]+3873151461&4294967295,L=S+(N<<11&4294967295|N>>>21),N=R+(L^S^w)+A[15]+530742520&4294967295,R=L+(N<<16&4294967295|N>>>16),N=w+(R^L^S)+A[2]+3299628645&4294967295,w=R+(N<<23&4294967295|N>>>9),N=S+(R^(w|~L))+A[0]+4096336452&4294967295,S=w+(N<<6&4294967295|N>>>26),N=L+(w^(S|~R))+A[7]+1126891415&4294967295,L=S+(N<<10&4294967295|N>>>22),N=R+(S^(L|~w))+A[14]+2878612391&4294967295,R=L+(N<<15&4294967295|N>>>17),N=w+(L^(R|~S))+A[5]+4237533241&4294967295,w=R+(N<<21&4294967295|N>>>11),N=S+(R^(w|~L))+A[12]+1700485571&4294967295,S=w+(N<<6&4294967295|N>>>26),N=L+(w^(S|~R))+A[3]+2399980690&4294967295,L=S+(N<<10&4294967295|N>>>22),N=R+(S^(L|~w))+A[10]+4293915773&4294967295,R=L+(N<<15&4294967295|N>>>17),N=w+(L^(R|~S))+A[1]+2240044497&4294967295,w=R+(N<<21&4294967295|N>>>11),N=S+(R^(w|~L))+A[8]+1873313359&4294967295,S=w+(N<<6&4294967295|N>>>26),N=L+(w^(S|~R))+A[15]+4264355552&4294967295,L=S+(N<<10&4294967295|N>>>22),N=R+(S^(L|~w))+A[6]+2734768916&4294967295,R=L+(N<<15&4294967295|N>>>17),N=w+(L^(R|~S))+A[13]+1309151649&4294967295,w=R+(N<<21&4294967295|N>>>11),N=S+(R^(w|~L))+A[4]+4149444226&4294967295,S=w+(N<<6&4294967295|N>>>26),N=L+(w^(S|~R))+A[11]+3174756917&4294967295,L=S+(N<<10&4294967295|N>>>22),N=R+(S^(L|~w))+A[2]+718787259&4294967295,R=L+(N<<15&4294967295|N>>>17),N=w+(L^(R|~S))+A[9]+3951481745&4294967295,T.g[0]=T.g[0]+S&4294967295,T.g[1]=T.g[1]+(R+(N<<21&4294967295|N>>>11))&4294967295,T.g[2]=T.g[2]+R&4294967295,T.g[3]=T.g[3]+L&4294967295}r.prototype.u=function(T,S){S===void 0&&(S=T.length);for(var w=S-this.blockSize,A=this.B,R=this.h,L=0;Lthis.h?this.blockSize:2*this.blockSize)-this.h);T[0]=128;for(var S=1;SS;++S)for(var A=0;32>A;A+=8)T[w++]=this.g[S]>>>A&255;return T};function i(T,S){var w=o;return Object.prototype.hasOwnProperty.call(w,T)?w[T]:w[T]=S(T)}function s(T,S){this.h=S;for(var w=[],A=!0,R=T.length-1;0<=R;R--){var L=T[R]|0;A&&L==S||(w[R]=L,A=!1)}this.g=w}var o={};function l(T){return-128<=T&&128>T?i(T,function(S){return new s([S|0],0>S?-1:0)}):new s([T|0],0>T?-1:0)}function u(T){if(isNaN(T)||!isFinite(T))return h;if(0>T)return _(u(-T));for(var S=[],w=1,A=0;T>=w;A++)S[A]=T/w|0,w*=4294967296;return new s(S,0)}function c(T,S){if(T.length==0)throw Error("number format error: empty string");if(S=S||10,2>S||36L?(L=u(Math.pow(S,L)),A=A.j(L).add(u(N))):(A=A.j(w),A=A.add(u(N)))}return A}var h=l(0),f=l(1),p=l(16777216);t=s.prototype,t.m=function(){if(m(this))return-_(this).m();for(var T=0,S=1,w=0;wT||36>>0).toString(T);if(w=R,g(w))return L+A;for(;6>L.length;)L="0"+L;A=L+A}},t.i=function(T){return 0>T?0:T>>16)+(this.i(R)>>>16)+(T.i(R)>>>16);A=N>>>16,L&=65535,N&=65535,w[R]=N<<16|L}return new s(w,w[w.length-1]&-2147483648?-1:0)};function x(T,S){return T.add(_(S))}t.j=function(T){if(g(this)||g(T))return h;if(m(this))return m(T)?_(this).j(_(T)):_(_(this).j(T));if(m(T))return _(this.j(_(T)));if(0>this.l(p)&&0>T.l(p))return u(this.m()*T.m());for(var S=this.g.length+T.g.length,w=[],A=0;A<2*S;A++)w[A]=0;for(A=0;A>>16,N=this.i(A)&65535,Re=T.i(R)>>>16,Pe=T.i(R)&65535;w[2*A+2*R]+=N*Pe,E(w,2*A+2*R),w[2*A+2*R+1]+=L*Pe,E(w,2*A+2*R+1),w[2*A+2*R+1]+=N*Re,E(w,2*A+2*R+1),w[2*A+2*R+2]+=L*Re,E(w,2*A+2*R+2)}for(A=0;A>>16,T[S]&=65535,S++}function y(T,S){this.g=T,this.h=S}function I(T,S){if(g(S))throw Error("division by zero");if(g(T))return new y(h,h);if(m(T))return S=I(_(T),S),new y(_(S.g),_(S.h));if(m(S))return S=I(T,_(S)),new y(_(S.g),S.h);if(30=A.l(T);)w=j(w),A=j(A);var R=G(w,1),L=G(A,1);for(A=G(A,2),w=G(w,2);!g(A);){var N=L.add(A);0>=N.l(T)&&(R=R.add(w),L=N),A=G(A,1),w=G(w,1)}return S=x(T,R.j(S)),new y(R,S)}for(R=h;0<=T.l(S);){for(w=Math.max(1,Math.floor(T.m()/S.m())),A=Math.ceil(Math.log(w)/Math.LN2),A=48>=A?1:Math.pow(2,A-48),L=u(w),N=L.j(S);m(N)||0>>31;return new s(w,T.h)}function G(T,S){var w=S>>5;S%=32;for(var A=T.g.length-w,R=[],L=0;L>>S|T.i(L+w+1)<<32-S:T.i(L+w);return new s(R,T.h)}r.prototype.digest=r.prototype.v,r.prototype.reset=r.prototype.s,r.prototype.update=r.prototype.u,s4=r,s.prototype.add=s.prototype.add,s.prototype.multiply=s.prototype.j,s.prototype.modulo=s.prototype.A,s.prototype.compare=s.prototype.l,s.prototype.toNumber=s.prototype.m,s.prototype.toString=s.prototype.toString,s.prototype.getBits=s.prototype.i,s.fromNumber=u,s.fromString=c,ro=s}).apply(typeof HT<"u"?HT:typeof self<"u"?self:typeof window<"u"?window:{});var cf=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};/** @license Copyright The Closure Library Authors. SPDX-License-Identifier: Apache-2.0 */var o4,l4,mc,u4,Wf,B1,c4,d4,h4;(function(){var t,e=typeof Object.defineProperties=="function"?Object.defineProperty:function(d,v,b){return d==Array.prototype||d==Object.prototype||(d[v]=b.value),d};function n(d){d=[typeof globalThis=="object"&&globalThis,d,typeof window=="object"&&window,typeof self=="object"&&self,typeof cf=="object"&&cf];for(var v=0;v{throw d},0)}function N(){var d=ye;let v=null;return d.g&&(v=d.g,d.g=d.g.next,d.g||(d.h=null),v.next=null),v}class Re{constructor(){this.h=this.g=null}add(v,b){const P=Pe.get();P.set(v,b),this.h?this.h.next=P:this.g=P,this.h=P}}var Pe=new x(()=>new ft,d=>d.reset());class ft{constructor(){this.next=this.g=this.h=null}set(v,b){this.h=v,this.g=b,this.next=null}reset(){this.next=this.g=this.h=null}}let Ue,le=!1,ye=new Re,we=()=>{const d=o.Promise.resolve(void 0);Ue=()=>{d.then(De)}};var De=()=>{for(var d;d=N();){try{d.h.call(d.g)}catch(b){L(b)}var v=Pe;v.j(d),100>v.h&&(v.h++,d.next=v.g,v.g=d)}le=!1};function V(){this.s=this.s,this.C=this.C}V.prototype.s=!1,V.prototype.ma=function(){this.s||(this.s=!0,this.N())},V.prototype.N=function(){if(this.C)for(;this.C.length;)this.C.shift()()};function H(d,v){this.type=d,this.g=this.target=v,this.defaultPrevented=!1}H.prototype.h=function(){this.defaultPrevented=!0};var q=function(){if(!o.addEventListener||!Object.defineProperty)return!1;var d=!1,v=Object.defineProperty({},"passive",{get:function(){d=!0}});try{const b=()=>{};o.addEventListener("test",b,v),o.removeEventListener("test",b,v)}catch{}return d}();function z(d,v){if(H.call(this,d?d.type:""),this.relatedTarget=this.g=this.target=null,this.button=this.screenY=this.screenX=this.clientY=this.clientX=0,this.key="",this.metaKey=this.shiftKey=this.altKey=this.ctrlKey=!1,this.state=null,this.pointerId=0,this.pointerType="",this.i=null,d){var b=this.type=d.type,P=d.changedTouches&&d.changedTouches.length?d.changedTouches[0]:null;if(this.target=d.target||d.srcElement,this.g=v,v=d.relatedTarget){if(j){e:{try{I(v.nodeName);var W=!0;break e}catch{}W=!1}W||(v=null)}}else b=="mouseover"?v=d.fromElement:b=="mouseout"&&(v=d.toElement);this.relatedTarget=v,P?(this.clientX=P.clientX!==void 0?P.clientX:P.pageX,this.clientY=P.clientY!==void 0?P.clientY:P.pageY,this.screenX=P.screenX||0,this.screenY=P.screenY||0):(this.clientX=d.clientX!==void 0?d.clientX:d.pageX,this.clientY=d.clientY!==void 0?d.clientY:d.pageY,this.screenX=d.screenX||0,this.screenY=d.screenY||0),this.button=d.button,this.key=d.key||"",this.ctrlKey=d.ctrlKey,this.altKey=d.altKey,this.shiftKey=d.shiftKey,this.metaKey=d.metaKey,this.pointerId=d.pointerId||0,this.pointerType=typeof d.pointerType=="string"?d.pointerType:re[d.pointerType]||"",this.state=d.state,this.i=d,d.defaultPrevented&&z.aa.h.call(this)}}g(z,H);var re={2:"touch",3:"pen",4:"mouse"};z.prototype.h=function(){z.aa.h.call(this);var d=this.i;d.preventDefault?d.preventDefault():d.returnValue=!1};var _e="closure_listenable_"+(1e6*Math.random()|0),Ae=0;function Se(d,v,b,P,W){this.listener=d,this.proxy=null,this.src=v,this.type=b,this.capture=!!P,this.ha=W,this.key=++Ae,this.da=this.fa=!1}function me(d){d.da=!0,d.listener=null,d.proxy=null,d.src=null,d.ha=null}function tt(d){this.src=d,this.g={},this.h=0}tt.prototype.add=function(d,v,b,P,W){var Z=d.toString();d=this.g[Z],d||(d=this.g[Z]=[],this.h++);var pe=Xt(d,v,P,W);return-1>>0);function Ns(d){return typeof d=="function"?d:(d[er]||(d[er]=function(v){return d.handleEvent(v)}),d[er])}function zt(){V.call(this),this.i=new tt(this),this.M=this,this.F=null}g(zt,V),zt.prototype[_e]=!0,zt.prototype.removeEventListener=function(d,v,b,P){Mr(this,d,v,b,P)};function Qt(d,v){var b,P=d.F;if(P)for(b=[];P;P=P.F)b.push(P);if(d=d.M,P=v.type||v,typeof v=="string")v=new H(v,d);else if(v instanceof H)v.target=v.target||d;else{var W=v;v=new H(P,d),A(v,W)}if(W=!0,b)for(var Z=b.length-1;0<=Z;Z--){var pe=v.g=b[Z];W=Lr(pe,P,!0,v)&&W}if(pe=v.g=d,W=Lr(pe,P,!0,v)&&W,W=Lr(pe,P,!1,v)&&W,b)for(Z=0;Z{d.g=null,d.i&&(d.i=!1,Nu(d))},d.l);const v=d.h;d.h=null,d.m.apply(null,v)}class Ih extends V{constructor(v,b){super(),this.m=v,this.l=b,this.h=null,this.i=!1,this.g=null}j(v){this.h=arguments,this.g?this.i=!0:Nu(this)}N(){super.N(),this.g&&(o.clearTimeout(this.g),this.g=null,this.i=!1,this.h=null)}}function xi(d){V.call(this),this.h=d,this.g={}}g(xi,V);var Ou=[];function Mu(d){G(d.g,function(v,b){this.g.hasOwnProperty(b)&&Hr(v)},d),d.g={}}xi.prototype.N=function(){xi.aa.N.call(this),Mu(this)},xi.prototype.handleEvent=function(){throw Error("EventHandler.handleEvent not implemented")};var Go=o.JSON.stringify,Hm=o.JSON.parse,Wm=class{stringify(d){return o.JSON.stringify(d,void 0)}parse(d){return o.JSON.parse(d,void 0)}};function Ho(){}Ho.prototype.h=null;function Lu(d){return d.h||(d.h=d.i())}function Du(){}var Os={OPEN:"a",kb:"b",Ja:"c",wb:"d"};function Fu(){H.call(this,"d")}g(Fu,H);function Si(){H.call(this,"c")}g(Si,H);var Fa={},Ph=null;function Wo(){return Ph=Ph||new zt}Fa.La="serverreachability";function Rh(d){H.call(this,Fa.La,d)}g(Rh,H);function Ms(d){const v=Wo();Qt(v,new Rh(v))}Fa.STAT_EVENT="statevent";function kh(d,v){H.call(this,Fa.STAT_EVENT,d),this.stat=v}g(kh,H);function mn(d){const v=Wo();Qt(v,new kh(v,d))}Fa.Ma="timingevent";function Nh(d,v){H.call(this,Fa.Ma,d),this.size=v}g(Nh,H);function Ba(d,v){if(typeof d!="function")throw Error("Fn must not be null and must be a function");return o.setTimeout(function(){d()},v)}function Ls(){this.g=!0}Ls.prototype.xa=function(){this.g=!1};function $m(d,v,b,P,W,Z){d.info(function(){if(d.g)if(Z)for(var pe="",gt=Z.split("&"),gn=0;gnP.length)){var W=P[1];if(Array.isArray(W)&&!(1>W.length)){var Z=W[0];if(Z!="noop"&&Z!="stop"&&Z!="close")for(var pe=1;pekn)&&(kn!=3||this.g&&(this.h.h||this.g.oa()||tx(this.g)))){this.J||kn!=4||v==7||(v==8||0>=Yo?Ms(3):Ms(2)),mt(this);var b=this.g.Z();this.X=b;t:if(Ee(this)){var P=tx(this.g);d="";var W=P.length,Z=ja(this.g)==4;if(!this.h.i){if(typeof TextDecoder>"u"){At(this),ot(this);var pe="";break t}this.h.i=new o.TextDecoder}for(v=0;vv.length?Q:(v=v.slice(P,P+b),d.C=P+b,v)))}te.prototype.cancel=function(){this.J=!0,At(this)};function ge(d){d.S=Date.now()+d.I,Le(d,d.I)}function Le(d,v){if(d.B!=null)throw Error("WatchDog timer not null");d.B=Ba(f(d.ba,d),v)}function mt(d){d.B&&(o.clearTimeout(d.B),d.B=null)}te.prototype.ba=function(){this.B=null;const d=Date.now();0<=d-this.S?(D(this.i,this.A),this.L!=2&&(Ms(),mn(17)),At(this),this.s=2,ot(this)):Le(this,this.S-d)};function ot(d){d.j.G==0||d.J||lx(d.j,d)}function At(d){mt(d);var v=d.M;v&&typeof v.ma=="function"&&v.ma(),d.M=null,Mu(d.U),d.g&&(v=d.g,d.g=null,v.abort(),v.ma())}function Ua(d,v){try{var b=d.j;if(b.G!=0&&(b.g==d||pr(b.h,d))){if(!d.K&&pr(b.h,d)&&b.G==3){try{var P=b.Da.g.parse(v)}catch{P=null}if(Array.isArray(P)&&P.length==3){var W=P;if(W[0]==0){e:if(!b.u){if(b.g)if(b.g.F+3e3W[2]&&b.F&&b.v==0&&!b.C&&(b.C=Ba(f(b.Za,b),6e3));if(1>=$o(b.h)&&b.ca){try{b.ca()}catch{}b.ca=void 0}}else Bs(b,11)}else if((d.K||b.g==d)&&Vh(b),!E(v))for(W=b.Da.g.parse(v),v=0;v=d.j:!1}function $o(d){return d.h?1:d.g?d.g.size:0}function pr(d,v){return d.h?d.h==v:d.g?d.g.has(v):!1}function Jm(d,v){d.g?d.g.add(v):d.h=v}function Vb(d,v){d.h&&d.h==v?d.h=null:d.g&&d.g.has(v)&&d.g.delete(v)}Ti.prototype.cancel=function(){if(this.i=jb(this),this.h)this.h.cancel(),this.h=null;else if(this.g&&this.g.size!==0){for(const d of this.g.values())d.cancel();this.g.clear()}};function jb(d){if(d.h!=null)return d.i.concat(d.h.D);if(d.g!=null&&d.g.size!==0){let v=d.i;for(const b of d.g.values())v=v.concat(b.D);return v}return m(d.i)}function R3(d){if(d.V&&typeof d.V=="function")return d.V();if(typeof Map<"u"&&d instanceof Map||typeof Set<"u"&&d instanceof Set)return Array.from(d.values());if(typeof d=="string")return d.split("");if(l(d)){for(var v=[],b=d.length,P=0;Pv)throw Error("Bad port number "+v);d.s=v}else d.s=null}function Gb(d,v,b){v instanceof Vu?(d.i=v,B3(d.i,d.h)):(b||(v=Uu(v,D3)),d.i=new Vu(v,d.h))}function bt(d,v,b){d.i.set(v,b)}function Lh(d){return bt(d,"zx",Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^Date.now()).toString(36)),d}function Bu(d,v){return d?v?decodeURI(d.replace(/%25/g,"%2525")):decodeURIComponent(d):""}function Uu(d,v,b){return typeof d=="string"?(d=encodeURI(d).replace(v,O3),b&&(d=d.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),d):null}function O3(d){return d=d.charCodeAt(0),"%"+(d>>4&15).toString(16)+(d&15).toString(16)}var Hb=/[#\/\?@]/g,M3=/[#\?:]/g,L3=/[#\?]/g,D3=/[#\?@]/g,F3=/#/g;function Vu(d,v){this.h=this.g=null,this.i=d||null,this.j=!!v}function wi(d){d.g||(d.g=new Map,d.h=0,d.i&&N3(d.i,function(v,b){d.add(decodeURIComponent(v.replace(/\+/g," ")),b)}))}t=Vu.prototype,t.add=function(d,v){wi(this),this.i=null,d=Ko(this,d);var b=this.g.get(d);return b||this.g.set(d,b=[]),b.push(v),this.h+=1,this};function Wb(d,v){wi(d),v=Ko(d,v),d.g.has(v)&&(d.i=null,d.h-=d.g.get(v).length,d.g.delete(v))}function $b(d,v){return wi(d),v=Ko(d,v),d.g.has(v)}t.forEach=function(d,v){wi(this),this.g.forEach(function(b,P){b.forEach(function(W){d.call(v,W,P,this)},this)},this)},t.na=function(){wi(this);const d=Array.from(this.g.values()),v=Array.from(this.g.keys()),b=[];for(let P=0;P{P.abort(),Ci(b,"TestPingServer: timeout",!1,v)},1e4);fetch(d,{signal:P.signal}).then(Z=>{clearTimeout(W),Z.ok?Ci(b,"TestPingServer: ok",!0,v):Ci(b,"TestPingServer: server error",!1,v)}).catch(()=>{clearTimeout(W),Ci(b,"TestPingServer: error",!1,v)})}function Ci(d,v,b,P,W){try{W&&(W.onload=null,W.onerror=null,W.onabort=null,W.ontimeout=null),P(b)}catch{}}function j3(){this.g=new Wm}function z3(d,v,b){const P=b||"";try{zb(d,function(W,Z){let pe=W;u(W)&&(pe=Go(W)),v.push(P+Z+"="+encodeURIComponent(pe))})}catch(W){throw v.push(P+"type="+encodeURIComponent("_badmap")),W}}function ju(d){this.l=d.Ub||null,this.j=d.eb||!1}g(ju,Ho),ju.prototype.g=function(){return new Dh(this.l,this.j)},ju.prototype.i=function(d){return function(){return d}}({});function Dh(d,v){zt.call(this),this.D=d,this.o=v,this.m=void 0,this.status=this.readyState=0,this.responseType=this.responseText=this.response=this.statusText="",this.onreadystatechange=null,this.u=new Headers,this.h=null,this.B="GET",this.A="",this.g=!1,this.v=this.j=this.l=null}g(Dh,zt),t=Dh.prototype,t.open=function(d,v){if(this.readyState!=0)throw this.abort(),Error("Error reopening a connection");this.B=d,this.A=v,this.readyState=1,qu(this)},t.send=function(d){if(this.readyState!=1)throw this.abort(),Error("need to call open() first. ");this.g=!0;const v={headers:this.u,method:this.B,credentials:this.m,cache:void 0};d&&(v.body=d),(this.D||o).fetch(new Request(this.A,v)).then(this.Sa.bind(this),this.ga.bind(this))},t.abort=function(){this.response=this.responseText="",this.u=new Headers,this.status=0,this.j&&this.j.cancel("Request was aborted.").catch(()=>{}),1<=this.readyState&&this.g&&this.readyState!=4&&(this.g=!1,zu(this)),this.readyState=0},t.Sa=function(d){if(this.g&&(this.l=d,this.h||(this.status=this.l.status,this.statusText=this.l.statusText,this.h=d.headers,this.readyState=2,qu(this)),this.g&&(this.readyState=3,qu(this),this.g)))if(this.responseType==="arraybuffer")d.arrayBuffer().then(this.Qa.bind(this),this.ga.bind(this));else if(typeof o.ReadableStream<"u"&&"body"in d){if(this.j=d.body.getReader(),this.o){if(this.responseType)throw Error('responseType must be empty for "streamBinaryChunks" mode responses.');this.response=[]}else this.response=this.responseText="",this.v=new TextDecoder;Jb(this)}else d.text().then(this.Ra.bind(this),this.ga.bind(this))};function Jb(d){d.j.read().then(d.Pa.bind(d)).catch(d.ga.bind(d))}t.Pa=function(d){if(this.g){if(this.o&&d.value)this.response.push(d.value);else if(!this.o){var v=d.value?d.value:new Uint8Array(0);(v=this.v.decode(v,{stream:!d.done}))&&(this.response=this.responseText+=v)}d.done?zu(this):qu(this),this.readyState==3&&Jb(this)}},t.Ra=function(d){this.g&&(this.response=this.responseText=d,zu(this))},t.Qa=function(d){this.g&&(this.response=d,zu(this))},t.ga=function(){this.g&&zu(this)};function zu(d){d.readyState=4,d.l=null,d.j=null,d.v=null,qu(d)}t.setRequestHeader=function(d,v){this.u.append(d,v)},t.getResponseHeader=function(d){return this.h&&this.h.get(d.toLowerCase())||""},t.getAllResponseHeaders=function(){if(!this.h)return"";const d=[],v=this.h.entries();for(var b=v.next();!b.done;)b=b.value,d.push(b[0]+": "+b[1]),b=v.next();return d.join(`\r `)};function qu(d){d.onreadystatechange&&d.onreadystatechange.call(d)}Object.defineProperty(Dh.prototype,"withCredentials",{get:function(){return this.m==="include"},set:function(d){this.m=d?"include":"same-origin"}});function Yb(d){let v="";return G(d,function(b,P){v+=P,v+=":",v+=b,v+=`\r `}),v}function Ym(d,v,b){e:{for(P in b){var P=!1;break e}P=!0}P||(b=Yb(b),typeof d=="string"?b!=null&&encodeURIComponent(String(b)):bt(d,v,b))}function Mt(d){zt.call(this),this.headers=new Map,this.o=d||null,this.h=!1,this.v=this.g=null,this.D="",this.m=0,this.l="",this.j=this.B=this.u=this.A=!1,this.I=null,this.H="",this.J=!1}g(Mt,zt);var q3=/^https?$/i,G3=["POST","PUT"];t=Mt.prototype,t.Ha=function(d){this.J=d},t.ea=function(d,v,b,P){if(this.g)throw Error("[goog.net.XhrIo] Object is active with another request="+this.D+"; newUri="+d);v=v?v.toUpperCase():"GET",this.D=d,this.l="",this.m=0,this.A=!1,this.h=!0,this.g=this.o?this.o.g():U.g(),this.v=this.o?Lu(this.o):Lu(U),this.g.onreadystatechange=f(this.Ea,this);try{this.B=!0,this.g.open(v,String(d),!0),this.B=!1}catch(Z){Xb(this,Z);return}if(d=b||"",b=new Map(this.headers),P)if(Object.getPrototypeOf(P)===Object.prototype)for(var W in P)b.set(W,P[W]);else if(typeof P.keys=="function"&&typeof P.get=="function")for(const Z of P.keys())b.set(Z,P.get(Z));else throw Error("Unknown input type for opt_headers: "+String(P));P=Array.from(b.keys()).find(Z=>Z.toLowerCase()=="content-type"),W=o.FormData&&d instanceof o.FormData,!(0<=Array.prototype.indexOf.call(G3,v,void 0))||P||W||b.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8");for(const[Z,pe]of b)this.g.setRequestHeader(Z,pe);this.H&&(this.g.responseType=this.H),"withCredentials"in this.g&&this.g.withCredentials!==this.J&&(this.g.withCredentials=this.J);try{ex(this),this.u=!0,this.g.send(d),this.u=!1}catch(Z){Xb(this,Z)}};function Xb(d,v){d.h=!1,d.g&&(d.j=!0,d.g.abort(),d.j=!1),d.l=v,d.m=5,Qb(d),Fh(d)}function Qb(d){d.A||(d.A=!0,Qt(d,"complete"),Qt(d,"error"))}t.abort=function(d){this.g&&this.h&&(this.h=!1,this.j=!0,this.g.abort(),this.j=!1,this.m=d||7,Qt(this,"complete"),Qt(this,"abort"),Fh(this))},t.N=function(){this.g&&(this.h&&(this.h=!1,this.j=!0,this.g.abort(),this.j=!1),Fh(this,!0)),Mt.aa.N.call(this)},t.Ea=function(){this.s||(this.B||this.u||this.j?Zb(this):this.bb())},t.bb=function(){Zb(this)};function Zb(d){if(d.h&&typeof s<"u"&&(!d.v[1]||ja(d)!=4||d.Z()!=2)){if(d.u&&ja(d)==4)Ah(d.Ea,0,d);else if(Qt(d,"readystatechange"),ja(d)==4){d.h=!1;try{const pe=d.Z();e:switch(pe){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:var v=!0;break e;default:v=!1}var b;if(!(b=v)){var P;if(P=pe===0){var W=String(d.D).match(qb)[1]||null;!W&&o.self&&o.self.location&&(W=o.self.location.protocol.slice(0,-1)),P=!q3.test(W?W.toLowerCase():"")}b=P}if(b)Qt(d,"complete"),Qt(d,"success");else{d.m=6;try{var Z=2{}:null;d.g=null,d.v=null,v||Qt(d,"ready");try{b.onreadystatechange=P}catch{}}}function ex(d){d.I&&(o.clearTimeout(d.I),d.I=null)}t.isActive=function(){return!!this.g};function ja(d){return d.g?d.g.readyState:0}t.Z=function(){try{return 2=d.h.j-(d.s?1:0)?!1:d.s?(d.i=v.D.concat(d.i),!0):d.G==1||d.G==2||d.B>=(d.Va?0:d.Wa)?!1:(d.s=Ba(f(d.Ga,d,v),ux(d,d.B)),d.B++,!0)}t.Ga=function(d){if(this.s)if(this.s=null,this.G==1){if(!d){this.U=Math.floor(1e5*Math.random()),d=this.U++;const W=new te(this,this.j,d);let Z=this.o;if(this.S&&(Z?(Z=S(Z),A(Z,this.S)):Z=this.S),this.m!==null||this.O||(W.H=Z,Z=null),this.P)e:{for(var v=0,b=0;bnt)Z=Math.max(0,W[gn].g-100),gt=!1;else try{z3(Rn,pe,"req"+nt+"_")}catch{P&&P(Rn)}}if(gt){P=pe.join("&");break e}}}return d=d.i.splice(0,b),v.D=d,P}function sx(d){if(!d.g&&!d.u){d.Y=1;var v=d.Fa;Ue||we(),le||(Ue(),le=!0),ye.add(v,d),d.v=0}}function Qm(d){return d.g||d.u||3<=d.v?!1:(d.Y++,d.u=Ba(f(d.Fa,d),ux(d,d.v)),d.v++,!0)}t.Fa=function(){if(this.u=null,ox(this),this.ba&&!(this.M||this.g==null||0>=this.R)){var d=2*this.R;this.j.info("BP detection timer enabled: "+d),this.A=Ba(f(this.ab,this),d)}},t.ab=function(){this.A&&(this.A=null,this.j.info("BP detection timeout reached."),this.j.info("Buffering proxy detected and switch to long-polling!"),this.F=!1,this.M=!0,mn(10),Bh(this),ox(this))};function Zm(d){d.A!=null&&(o.clearTimeout(d.A),d.A=null)}function ox(d){d.g=new te(d,d.j,"rpc",d.Y),d.m===null&&(d.g.H=d.o),d.g.O=0;var v=Va(d.qa);bt(v,"RID","rpc"),bt(v,"SID",d.K),bt(v,"AID",d.T),bt(v,"CI",d.F?"0":"1"),!d.F&&d.ja&&bt(v,"TO",d.ja),bt(v,"TYPE","xmlhttp"),Hu(d,v),d.m&&d.o&&Ym(v,d.m,d.o),d.L&&(d.g.I=d.L);var b=d.g;d=d.ia,b.L=1,b.v=Lh(Va(v)),b.m=null,b.P=!0,fe(b,d)}t.Za=function(){this.C!=null&&(this.C=null,Bh(this),Qm(this),mn(19))};function Vh(d){d.C!=null&&(o.clearTimeout(d.C),d.C=null)}function lx(d,v){var b=null;if(d.g==v){Vh(d),Zm(d),d.g=null;var P=2}else if(pr(d.h,v))b=v.D,Vb(d.h,v),P=1;else return;if(d.G!=0){if(v.o)if(P==1){b=v.m?v.m.length:0,v=Date.now()-v.F;var W=d.B;P=Wo(),Qt(P,new Nh(P,b)),Uh(d)}else sx(d);else if(W=v.s,W==3||W==0&&0`${this.name}: [code=${this.code}]: ${this.message}`}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class ao{constructor(){this.promise=new Promise((e,n)=>{this.resolve=e,this.reject=n})}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class f4{constructor(e,n){this.user=n,this.type="OAuth",this.headers=new Map,this.headers.set("Authorization",`Bearer ${e}`)}}class TU{getToken(){return Promise.resolve(null)}invalidateToken(){}start(e,n){e.enqueueRetryable(()=>n(Ln.UNAUTHENTICATED))}shutdown(){}}class wU{constructor(e){this.token=e,this.changeListener=null}getToken(){return Promise.resolve(this.token)}invalidateToken(){}start(e,n){this.changeListener=n,e.enqueueRetryable(()=>n(this.token.user))}shutdown(){this.changeListener=null}}class CU{constructor(e){this.t=e,this.currentUser=Ln.UNAUTHENTICATED,this.i=0,this.forceRefresh=!1,this.auth=null}start(e,n){let r=this.i;const a=l=>this.i!==r?(r=this.i,n(l)):Promise.resolve();let i=new ao;this.o=()=>{this.i++,this.currentUser=this.u(),i.resolve(),i=new ao,e.enqueueRetryable(()=>a(this.currentUser))};const s=()=>{const l=i;e.enqueueRetryable(async()=>{await l.promise,await a(this.currentUser)})},o=l=>{Ce("FirebaseAuthCredentialsProvider","Auth detected"),this.auth=l,this.auth.addAuthTokenListener(this.o),s()};this.t.onInit(l=>o(l)),setTimeout(()=>{if(!this.auth){const l=this.t.getImmediate({optional:!0});l?o(l):(Ce("FirebaseAuthCredentialsProvider","Auth not yet detected"),i.resolve(),i=new ao)}},0),s()}getToken(){const e=this.i,n=this.forceRefresh;return this.forceRefresh=!1,this.auth?this.auth.getToken(n).then(r=>this.i!==e?(Ce("FirebaseAuthCredentialsProvider","getToken aborted due to token change."),this.getToken()):r?($t(typeof r.accessToken=="string"),new f4(r.accessToken,this.currentUser)):null):Promise.resolve(null)}invalidateToken(){this.forceRefresh=!0}shutdown(){this.auth&&this.auth.removeAuthTokenListener(this.o)}u(){const e=this.auth&&this.auth.getUid();return $t(e===null||typeof e=="string"),new Ln(e)}}class AU{constructor(e,n,r){this.l=e,this.h=n,this.P=r,this.type="FirstParty",this.user=Ln.FIRST_PARTY,this.I=new Map}T(){return this.P?this.P():null}get headers(){this.I.set("X-Goog-AuthUser",this.l);const e=this.T();return e&&this.I.set("Authorization",e),this.h&&this.I.set("X-Goog-Iam-Authorization-Token",this.h),this.I}}class IU{constructor(e,n,r){this.l=e,this.h=n,this.P=r}getToken(){return Promise.resolve(new AU(this.l,this.h,this.P))}start(e,n){e.enqueueRetryable(()=>n(Ln.FIRST_PARTY))}shutdown(){}invalidateToken(){}}class PU{constructor(e){this.value=e,this.type="AppCheck",this.headers=new Map,e&&e.length>0&&this.headers.set("x-firebase-appcheck",this.value)}}class RU{constructor(e){this.A=e,this.forceRefresh=!1,this.appCheck=null,this.R=null}start(e,n){const r=i=>{i.error!=null&&Ce("FirebaseAppCheckTokenProvider",`Error getting App Check token; using placeholder token instead. Error: ${i.error.message}`);const s=i.token!==this.R;return this.R=i.token,Ce("FirebaseAppCheckTokenProvider",`Received ${s?"new":"existing"} token.`),s?n(i.token):Promise.resolve()};this.o=i=>{e.enqueueRetryable(()=>r(i))};const a=i=>{Ce("FirebaseAppCheckTokenProvider","AppCheck detected"),this.appCheck=i,this.appCheck.addTokenListener(this.o)};this.A.onInit(i=>a(i)),setTimeout(()=>{if(!this.appCheck){const i=this.A.getImmediate({optional:!0});i?a(i):Ce("FirebaseAppCheckTokenProvider","AppCheck not yet detected")}},0)}getToken(){const e=this.forceRefresh;return this.forceRefresh=!1,this.appCheck?this.appCheck.getToken(e).then(n=>n?($t(typeof n.token=="string"),this.R=n.token,new PU(n.token)):null):Promise.resolve(null)}invalidateToken(){this.forceRefresh=!0}shutdown(){this.appCheck&&this.appCheck.removeTokenListener(this.o)}}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function kU(t){const e=typeof self<"u"&&(self.crypto||self.msCrypto),n=new Uint8Array(t);if(e&&typeof e.getRandomValues=="function")e.getRandomValues(n);else for(let r=0;re?1:0}function tu(t,e,n){return t.length===e.length&&t.every((r,a)=>n(r,e[a]))}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class or{constructor(e,n){if(this.seconds=e,this.nanoseconds=n,n<0)throw new ke(ve.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+n);if(n>=1e9)throw new ke(ve.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+n);if(e<-62135596800)throw new ke(ve.INVALID_ARGUMENT,"Timestamp seconds out of range: "+e);if(e>=253402300800)throw new ke(ve.INVALID_ARGUMENT,"Timestamp seconds out of range: "+e)}static now(){return or.fromMillis(Date.now())}static fromDate(e){return or.fromMillis(e.getTime())}static fromMillis(e){const n=Math.floor(e/1e3),r=Math.floor(1e6*(e-1e3*n));return new or(n,r)}toDate(){return new Date(this.toMillis())}toMillis(){return 1e3*this.seconds+this.nanoseconds/1e6}_compareTo(e){return this.seconds===e.seconds?it(this.nanoseconds,e.nanoseconds):it(this.seconds,e.seconds)}isEqual(e){return e.seconds===this.seconds&&e.nanoseconds===this.nanoseconds}toString(){return"Timestamp(seconds="+this.seconds+", nanoseconds="+this.nanoseconds+")"}toJSON(){return{seconds:this.seconds,nanoseconds:this.nanoseconds}}valueOf(){const e=this.seconds- -62135596800;return String(e).padStart(12,"0")+"."+String(this.nanoseconds).padStart(9,"0")}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class Fe{constructor(e){this.timestamp=e}static fromTimestamp(e){return new Fe(e)}static min(){return new Fe(new or(0,0))}static max(){return new Fe(new or(253402300799,999999999))}compareTo(e){return this.timestamp._compareTo(e.timestamp)}isEqual(e){return this.timestamp.isEqual(e.timestamp)}toMicroseconds(){return 1e6*this.timestamp.seconds+this.timestamp.nanoseconds/1e3}toString(){return"SnapshotVersion("+this.timestamp.toString()+")"}toTimestamp(){return this.timestamp}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class Ad{constructor(e,n,r){n===void 0?n=0:n>e.length&&ze(),r===void 0?r=e.length-n:r>e.length-n&&ze(),this.segments=e,this.offset=n,this.len=r}get length(){return this.len}isEqual(e){return Ad.comparator(this,e)===0}child(e){const n=this.segments.slice(this.offset,this.limit());return e instanceof Ad?e.forEach(r=>{n.push(r)}):n.push(e),this.construct(n)}limit(){return this.offset+this.length}popFirst(e){return e=e===void 0?1:e,this.construct(this.segments,this.offset+e,this.length-e)}popLast(){return this.construct(this.segments,this.offset,this.length-1)}firstSegment(){return this.segments[this.offset]}lastSegment(){return this.get(this.length-1)}get(e){return this.segments[this.offset+e]}isEmpty(){return this.length===0}isPrefixOf(e){if(e.lengths)return 1}return e.lengthn.length?1:0}}class Ft extends Ad{construct(e,n,r){return new Ft(e,n,r)}canonicalString(){return this.toArray().join("/")}toString(){return this.canonicalString()}toUriEncodedString(){return this.toArray().map(encodeURIComponent).join("/")}static fromString(...e){const n=[];for(const r of e){if(r.indexOf("//")>=0)throw new ke(ve.INVALID_ARGUMENT,`Invalid segment (${r}). Paths must not contain // in them.`);n.push(...r.split("/").filter(a=>a.length>0))}return new Ft(n)}static emptyPath(){return new Ft([])}}const NU=/^[_a-zA-Z][_a-zA-Z0-9]*$/;class Wn extends Ad{construct(e,n,r){return new Wn(e,n,r)}static isValidIdentifier(e){return NU.test(e)}canonicalString(){return this.toArray().map(e=>(e=e.replace(/\\/g,"\\\\").replace(/`/g,"\\`"),Wn.isValidIdentifier(e)||(e="`"+e+"`"),e)).join(".")}toString(){return this.canonicalString()}isKeyField(){return this.length===1&&this.get(0)==="__name__"}static keyField(){return new Wn(["__name__"])}static fromServerFormat(e){const n=[];let r="",a=0;const i=()=>{if(r.length===0)throw new ke(ve.INVALID_ARGUMENT,`Invalid field path (${e}). Paths must not be empty, begin with '.', end with '.', or contain '..'`);n.push(r),r=""};let s=!1;for(;a=2&&this.path.get(this.path.length-2)===e}getCollectionGroup(){return this.path.get(this.path.length-2)}getCollectionPath(){return this.path.popLast()}isEqual(e){return e!==null&&Ft.comparator(this.path,e.path)===0}toString(){return this.path.toString()}static comparator(e,n){return Ft.comparator(e.path,n.path)}static isDocumentKey(e){return e.length%2==0}static fromSegments(e){return new Ne(new Ft(e.slice()))}}function OU(t,e){const n=t.toTimestamp().seconds,r=t.toTimestamp().nanoseconds+1,a=Fe.fromTimestamp(r===1e9?new or(n+1,0):new or(n,r));return new gs(a,Ne.empty(),e)}function MU(t){return new gs(t.readTime,t.key,-1)}class gs{constructor(e,n,r){this.readTime=e,this.documentKey=n,this.largestBatchId=r}static min(){return new gs(Fe.min(),Ne.empty(),-1)}static max(){return new gs(Fe.max(),Ne.empty(),-1)}}function LU(t,e){let n=t.readTime.compareTo(e.readTime);return n!==0?n:(n=Ne.comparator(t.documentKey,e.documentKey),n!==0?n:it(t.largestBatchId,e.largestBatchId))}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const DU="The current tab is not in the required state to perform this operation. It might be necessary to refresh the browser tab.";class FU{constructor(){this.onCommittedListeners=[]}addOnCommittedListener(e){this.onCommittedListeners.push(e)}raiseOnCommittedEvent(){this.onCommittedListeners.forEach(e=>e())}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */async function CE(t){if(t.code!==ve.FAILED_PRECONDITION||t.message!==DU)throw t;Ce("LocalStore","Unexpectedly lost primary lease")}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class ie{constructor(e){this.nextCallback=null,this.catchCallback=null,this.result=void 0,this.error=void 0,this.isDone=!1,this.callbackAttached=!1,e(n=>{this.isDone=!0,this.result=n,this.nextCallback&&this.nextCallback(n)},n=>{this.isDone=!0,this.error=n,this.catchCallback&&this.catchCallback(n)})}catch(e){return this.next(void 0,e)}next(e,n){return this.callbackAttached&&ze(),this.callbackAttached=!0,this.isDone?this.error?this.wrapFailure(n,this.error):this.wrapSuccess(e,this.result):new ie((r,a)=>{this.nextCallback=i=>{this.wrapSuccess(e,i).next(r,a)},this.catchCallback=i=>{this.wrapFailure(n,i).next(r,a)}})}toPromise(){return new Promise((e,n)=>{this.next(e,n)})}wrapUserFunction(e){try{const n=e();return n instanceof ie?n:ie.resolve(n)}catch(n){return ie.reject(n)}}wrapSuccess(e,n){return e?this.wrapUserFunction(()=>e(n)):ie.resolve(n)}wrapFailure(e,n){return e?this.wrapUserFunction(()=>e(n)):ie.reject(n)}static resolve(e){return new ie((n,r)=>{n(e)})}static reject(e){return new ie((n,r)=>{r(e)})}static waitFor(e){return new ie((n,r)=>{let a=0,i=0,s=!1;e.forEach(o=>{++a,o.next(()=>{++i,s&&i===a&&n()},l=>r(l))}),s=!0,i===a&&n()})}static or(e){let n=ie.resolve(!1);for(const r of e)n=n.next(a=>a?ie.resolve(a):r());return n}static forEach(e,n){const r=[];return e.forEach((a,i)=>{r.push(n.call(this,a,i))}),this.waitFor(r)}static mapArray(e,n){return new ie((r,a)=>{const i=e.length,s=new Array(i);let o=0;for(let l=0;l{s[u]=c,++o,o===i&&r(s)},c=>a(c))}})}static doWhile(e,n){return new ie((r,a)=>{const i=()=>{e()===!0?n().next(()=>{i()},a):r()};i()})}}function BU(t){const e=t.match(/Android ([\d.]+)/i),n=e?e[1].split(".").slice(0,2).join("."):"-1";return Number(n)}function dh(t){return t.name==="IndexedDbTransactionError"}/** * @license * Copyright 2018 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class AE{constructor(e,n){this.previousValue=e,n&&(n.sequenceNumberHandler=r=>this.ie(r),this.se=r=>n.writeSequenceNumber(r))}ie(e){return this.previousValue=Math.max(e,this.previousValue),this.previousValue}next(){const e=++this.previousValue;return this.se&&this.se(e),e}}AE.oe=-1;function cm(t){return t==null}function U1(t){return t===0&&1/t==-1/0}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function $T(t){let e=0;for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&e++;return e}function dm(t,e){for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&e(n,t[n])}function UU(t){for(const e in t)if(Object.prototype.hasOwnProperty.call(t,e))return!1;return!0}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class jt{constructor(e,n){this.comparator=e,this.root=n||bn.EMPTY}insert(e,n){return new jt(this.comparator,this.root.insert(e,n,this.comparator).copy(null,null,bn.BLACK,null,null))}remove(e){return new jt(this.comparator,this.root.remove(e,this.comparator).copy(null,null,bn.BLACK,null,null))}get(e){let n=this.root;for(;!n.isEmpty();){const r=this.comparator(e,n.key);if(r===0)return n.value;r<0?n=n.left:r>0&&(n=n.right)}return null}indexOf(e){let n=0,r=this.root;for(;!r.isEmpty();){const a=this.comparator(e,r.key);if(a===0)return n+r.left.size;a<0?r=r.left:(n+=r.left.size+1,r=r.right)}return-1}isEmpty(){return this.root.isEmpty()}get size(){return this.root.size}minKey(){return this.root.minKey()}maxKey(){return this.root.maxKey()}inorderTraversal(e){return this.root.inorderTraversal(e)}forEach(e){this.inorderTraversal((n,r)=>(e(n,r),!1))}toString(){const e=[];return this.inorderTraversal((n,r)=>(e.push(`${n}:${r}`),!1)),`{${e.join(", ")}}`}reverseTraversal(e){return this.root.reverseTraversal(e)}getIterator(){return new df(this.root,null,this.comparator,!1)}getIteratorFrom(e){return new df(this.root,e,this.comparator,!1)}getReverseIterator(){return new df(this.root,null,this.comparator,!0)}getReverseIteratorFrom(e){return new df(this.root,e,this.comparator,!0)}}class df{constructor(e,n,r,a){this.isReverse=a,this.nodeStack=[];let i=1;for(;!e.isEmpty();)if(i=n?r(e.key,n):1,n&&a&&(i*=-1),i<0)e=this.isReverse?e.left:e.right;else{if(i===0){this.nodeStack.push(e);break}this.nodeStack.push(e),e=this.isReverse?e.right:e.left}}getNext(){let e=this.nodeStack.pop();const n={key:e.key,value:e.value};if(this.isReverse)for(e=e.left;!e.isEmpty();)this.nodeStack.push(e),e=e.right;else for(e=e.right;!e.isEmpty();)this.nodeStack.push(e),e=e.left;return n}hasNext(){return this.nodeStack.length>0}peek(){if(this.nodeStack.length===0)return null;const e=this.nodeStack[this.nodeStack.length-1];return{key:e.key,value:e.value}}}class bn{constructor(e,n,r,a,i){this.key=e,this.value=n,this.color=r??bn.RED,this.left=a??bn.EMPTY,this.right=i??bn.EMPTY,this.size=this.left.size+1+this.right.size}copy(e,n,r,a,i){return new bn(e??this.key,n??this.value,r??this.color,a??this.left,i??this.right)}isEmpty(){return!1}inorderTraversal(e){return this.left.inorderTraversal(e)||e(this.key,this.value)||this.right.inorderTraversal(e)}reverseTraversal(e){return this.right.reverseTraversal(e)||e(this.key,this.value)||this.left.reverseTraversal(e)}min(){return this.left.isEmpty()?this:this.left.min()}minKey(){return this.min().key}maxKey(){return this.right.isEmpty()?this.key:this.right.maxKey()}insert(e,n,r){let a=this;const i=r(e,a.key);return a=i<0?a.copy(null,null,null,a.left.insert(e,n,r),null):i===0?a.copy(null,n,null,null,null):a.copy(null,null,null,null,a.right.insert(e,n,r)),a.fixUp()}removeMin(){if(this.left.isEmpty())return bn.EMPTY;let e=this;return e.left.isRed()||e.left.left.isRed()||(e=e.moveRedLeft()),e=e.copy(null,null,null,e.left.removeMin(),null),e.fixUp()}remove(e,n){let r,a=this;if(n(e,a.key)<0)a.left.isEmpty()||a.left.isRed()||a.left.left.isRed()||(a=a.moveRedLeft()),a=a.copy(null,null,null,a.left.remove(e,n),null);else{if(a.left.isRed()&&(a=a.rotateRight()),a.right.isEmpty()||a.right.isRed()||a.right.left.isRed()||(a=a.moveRedRight()),n(e,a.key)===0){if(a.right.isEmpty())return bn.EMPTY;r=a.right.min(),a=a.copy(r.key,r.value,null,null,a.right.removeMin())}a=a.copy(null,null,null,null,a.right.remove(e,n))}return a.fixUp()}isRed(){return this.color}fixUp(){let e=this;return e.right.isRed()&&!e.left.isRed()&&(e=e.rotateLeft()),e.left.isRed()&&e.left.left.isRed()&&(e=e.rotateRight()),e.left.isRed()&&e.right.isRed()&&(e=e.colorFlip()),e}moveRedLeft(){let e=this.colorFlip();return e.right.left.isRed()&&(e=e.copy(null,null,null,null,e.right.rotateRight()),e=e.rotateLeft(),e=e.colorFlip()),e}moveRedRight(){let e=this.colorFlip();return e.left.left.isRed()&&(e=e.rotateRight(),e=e.colorFlip()),e}rotateLeft(){const e=this.copy(null,null,bn.RED,null,this.right.left);return this.right.copy(null,null,this.color,e,null)}rotateRight(){const e=this.copy(null,null,bn.RED,this.left.right,null);return this.left.copy(null,null,this.color,null,e)}colorFlip(){const e=this.left.copy(null,null,!this.left.color,null,null),n=this.right.copy(null,null,!this.right.color,null,null);return this.copy(null,null,!this.color,e,n)}checkMaxDepth(){const e=this.check();return Math.pow(2,e)<=this.size+1}check(){if(this.isRed()&&this.left.isRed()||this.right.isRed())throw ze();const e=this.left.check();if(e!==this.right.check())throw ze();return e+(this.isRed()?0:1)}}bn.EMPTY=null,bn.RED=!0,bn.BLACK=!1;bn.EMPTY=new class{constructor(){this.size=0}get key(){throw ze()}get value(){throw ze()}get color(){throw ze()}get left(){throw ze()}get right(){throw ze()}copy(e,n,r,a,i){return this}insert(e,n,r){return new bn(e,n)}remove(e,n){return this}isEmpty(){return!0}inorderTraversal(e){return!1}reverseTraversal(e){return!1}minKey(){return null}maxKey(){return null}isRed(){return!1}checkMaxDepth(){return!0}check(){return 0}};/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class wn{constructor(e){this.comparator=e,this.data=new jt(this.comparator)}has(e){return this.data.get(e)!==null}first(){return this.data.minKey()}last(){return this.data.maxKey()}get size(){return this.data.size}indexOf(e){return this.data.indexOf(e)}forEach(e){this.data.inorderTraversal((n,r)=>(e(n),!1))}forEachInRange(e,n){const r=this.data.getIteratorFrom(e[0]);for(;r.hasNext();){const a=r.getNext();if(this.comparator(a.key,e[1])>=0)return;n(a.key)}}forEachWhile(e,n){let r;for(r=n!==void 0?this.data.getIteratorFrom(n):this.data.getIterator();r.hasNext();)if(!e(r.getNext().key))return}firstAfterOrEqual(e){const n=this.data.getIteratorFrom(e);return n.hasNext()?n.getNext().key:null}getIterator(){return new KT(this.data.getIterator())}getIteratorFrom(e){return new KT(this.data.getIteratorFrom(e))}add(e){return this.copy(this.data.remove(e).insert(e,!0))}delete(e){return this.has(e)?this.copy(this.data.remove(e)):this}isEmpty(){return this.data.isEmpty()}unionWith(e){let n=this;return n.size{n=n.add(r)}),n}isEqual(e){if(!(e instanceof wn)||this.size!==e.size)return!1;const n=this.data.getIterator(),r=e.data.getIterator();for(;n.hasNext();){const a=n.getNext().key,i=r.getNext().key;if(this.comparator(a,i)!==0)return!1}return!0}toArray(){const e=[];return this.forEach(n=>{e.push(n)}),e}toString(){const e=[];return this.forEach(n=>e.push(n)),"SortedSet("+e.toString()+")"}copy(e){const n=new wn(this.comparator);return n.data=e,n}}class KT{constructor(e){this.iter=e}getNext(){return this.iter.getNext().key}hasNext(){return this.iter.hasNext()}}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class qi{constructor(e){this.fields=e,e.sort(Wn.comparator)}static empty(){return new qi([])}unionWith(e){let n=new wn(Wn.comparator);for(const r of this.fields)n=n.add(r);for(const r of e)n=n.add(r);return new qi(n.toArray())}covers(e){for(const n of this.fields)if(n.isPrefixOf(e))return!0;return!1}isEqual(e){return tu(this.fields,e.fields,(n,r)=>n.isEqual(r))}}/** * @license * Copyright 2023 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class m4 extends Error{constructor(){super(...arguments),this.name="Base64DecodeError"}}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class In{constructor(e){this.binaryString=e}static fromBase64String(e){const n=function(a){try{return atob(a)}catch(i){throw typeof DOMException<"u"&&i instanceof DOMException?new m4("Invalid base64 string: "+i):i}}(e);return new In(n)}static fromUint8Array(e){const n=function(a){let i="";for(let s=0;seka(n,e))!==void 0}function nu(t,e){if(t===e)return 0;const n=To(t),r=To(e);if(n!==r)return it(n,r);switch(n){case 0:case 9007199254740991:return 0;case 1:return it(t.booleanValue,e.booleanValue);case 2:return function(i,s){const o=Ut(i.integerValue||i.doubleValue),l=Ut(s.integerValue||s.doubleValue);return ol?1:o===l?0:isNaN(o)?isNaN(l)?0:-1:1}(t,e);case 3:return JT(t.timestampValue,e.timestampValue);case 4:return JT(Id(t),Id(e));case 5:return it(t.stringValue,e.stringValue);case 6:return function(i,s){const o=So(i),l=So(s);return o.compareTo(l)}(t.bytesValue,e.bytesValue);case 7:return function(i,s){const o=i.split("/"),l=s.split("/");for(let u=0;ue.mapValue.fields[n]=Dc(r)),e}if(t.arrayValue){const e={arrayValue:{values:[]}};for(let n=0;n<(t.arrayValue.values||[]).length;++n)e.arrayValue.values[n]=Dc(t.arrayValue.values[n]);return e}return Object.assign({},t)}function qU(t){return(((t.mapValue||{}).fields||{}).__type__||{}).stringValue==="__max__"}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class Ea{constructor(e){this.value=e}static empty(){return new Ea({mapValue:{}})}field(e){if(e.isEmpty())return this.value;{let n=this.value;for(let r=0;r{if(!n.isImmediateParentOf(o)){const l=this.getFieldsMap(n);this.applyChanges(l,r,a),r={},a=[],n=o.popLast()}s?r[o.lastSegment()]=Dc(s):a.push(o.lastSegment())});const i=this.getFieldsMap(n);this.applyChanges(i,r,a)}delete(e){const n=this.field(e.popLast());zg(n)&&n.mapValue.fields&&delete n.mapValue.fields[e.lastSegment()]}isEqual(e){return ka(this.value,e.value)}getFieldsMap(e){let n=this.value;n.mapValue.fields||(n.mapValue={fields:{}});for(let r=0;re[a]=i);for(const a of r)delete e[a]}clone(){return new Ea(Dc(this.value))}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class Bn{constructor(e,n,r,a,i,s,o){this.key=e,this.documentType=n,this.version=r,this.readTime=a,this.createTime=i,this.data=s,this.documentState=o}static newInvalidDocument(e){return new Bn(e,0,Fe.min(),Fe.min(),Fe.min(),Ea.empty(),0)}static newFoundDocument(e,n,r,a){return new Bn(e,1,n,Fe.min(),r,a,0)}static newNoDocument(e,n){return new Bn(e,2,n,Fe.min(),Fe.min(),Ea.empty(),0)}static newUnknownDocument(e,n){return new Bn(e,3,n,Fe.min(),Fe.min(),Ea.empty(),2)}convertToFoundDocument(e,n){return!this.createTime.isEqual(Fe.min())||this.documentType!==2&&this.documentType!==0||(this.createTime=e),this.version=e,this.documentType=1,this.data=n,this.documentState=0,this}convertToNoDocument(e){return this.version=e,this.documentType=2,this.data=Ea.empty(),this.documentState=0,this}convertToUnknownDocument(e){return this.version=e,this.documentType=3,this.data=Ea.empty(),this.documentState=2,this}setHasCommittedMutations(){return this.documentState=2,this}setHasLocalMutations(){return this.documentState=1,this.version=Fe.min(),this}setReadTime(e){return this.readTime=e,this}get hasLocalMutations(){return this.documentState===1}get hasCommittedMutations(){return this.documentState===2}get hasPendingWrites(){return this.hasLocalMutations||this.hasCommittedMutations}isValidDocument(){return this.documentType!==0}isFoundDocument(){return this.documentType===1}isNoDocument(){return this.documentType===2}isUnknownDocument(){return this.documentType===3}isEqual(e){return e instanceof Bn&&this.key.isEqual(e.key)&&this.version.isEqual(e.version)&&this.documentType===e.documentType&&this.documentState===e.documentState&&this.data.isEqual(e.data)}mutableCopy(){return new Bn(this.key,this.documentType,this.version,this.readTime,this.createTime,this.data.clone(),this.documentState)}toString(){return`Document(${this.key}, ${this.version}, ${JSON.stringify(this.data.value)}, {createTime: ${this.createTime}}), {documentType: ${this.documentType}}), {documentState: ${this.documentState}})`}}/** * @license * Copyright 2022 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class Yp{constructor(e,n){this.position=e,this.inclusive=n}}function ZT(t,e,n){let r=0;for(let a=0;a":return e>0;case">=":return e>=0;default:return ze()}}isInequality(){return["<","<=",">",">=","!=","not-in"].indexOf(this.op)>=0}getFlattenedFilters(){return[this]}getFilters(){return[this]}}class Na extends g4{constructor(e,n){super(),this.filters=e,this.op=n,this.ae=null}static create(e,n){return new Na(e,n)}matches(e){return v4(this)?this.filters.find(n=>!n.matches(e))===void 0:this.filters.find(n=>n.matches(e))!==void 0}getFlattenedFilters(){return this.ae!==null||(this.ae=this.filters.reduce((e,n)=>e.concat(n.getFlattenedFilters()),[])),this.ae}getFilters(){return Object.assign([],this.filters)}}function v4(t){return t.op==="and"}function _4(t){return HU(t)&&v4(t)}function HU(t){for(const e of t.filters)if(e instanceof Na)return!1;return!0}function z1(t){if(t instanceof rn)return t.field.canonicalString()+t.op.toString()+ru(t.value);if(_4(t))return t.filters.map(e=>z1(e)).join(",");{const e=t.filters.map(n=>z1(n)).join(",");return`${t.op}(${e})`}}function y4(t,e){return t instanceof rn?function(r,a){return a instanceof rn&&r.op===a.op&&r.field.isEqual(a.field)&&ka(r.value,a.value)}(t,e):t instanceof Na?function(r,a){return a instanceof Na&&r.op===a.op&&r.filters.length===a.filters.length?r.filters.reduce((i,s,o)=>i&&y4(s,a.filters[o]),!0):!1}(t,e):void ze()}function E4(t){return t instanceof rn?function(n){return`${n.field.canonicalString()} ${n.op} ${ru(n.value)}`}(t):t instanceof Na?function(n){return n.op.toString()+" {"+n.getFilters().map(E4).join(" ,")+"}"}(t):"Filter"}class WU extends rn{constructor(e,n,r){super(e,n,r),this.key=Ne.fromName(r.referenceValue)}matches(e){const n=Ne.comparator(e.key,this.key);return this.matchesComparison(n)}}class $U extends rn{constructor(e,n){super(e,"in",n),this.keys=b4("in",n)}matches(e){return this.keys.some(n=>n.isEqual(e.key))}}class KU extends rn{constructor(e,n){super(e,"not-in",n),this.keys=b4("not-in",n)}matches(e){return!this.keys.some(n=>n.isEqual(e.key))}}function b4(t,e){var n;return(((n=e.arrayValue)===null||n===void 0?void 0:n.values)||[]).map(r=>Ne.fromName(r.referenceValue))}class JU extends rn{constructor(e,n){super(e,"array-contains",n)}matches(e){const n=e.data.field(this.field);return RE(n)&&Rd(n.arrayValue,this.value)}}class YU extends rn{constructor(e,n){super(e,"in",n)}matches(e){const n=e.data.field(this.field);return n!==null&&Rd(this.value.arrayValue,n)}}class XU extends rn{constructor(e,n){super(e,"not-in",n)}matches(e){if(Rd(this.value.arrayValue,{nullValue:"NULL_VALUE"}))return!1;const n=e.data.field(this.field);return n!==null&&!Rd(this.value.arrayValue,n)}}class QU extends rn{constructor(e,n){super(e,"array-contains-any",n)}matches(e){const n=e.data.field(this.field);return!(!RE(n)||!n.arrayValue.values)&&n.arrayValue.values.some(r=>Rd(this.value.arrayValue,r))}}/** * @license * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class ZU{constructor(e,n=null,r=[],a=[],i=null,s=null,o=null){this.path=e,this.collectionGroup=n,this.orderBy=r,this.filters=a,this.limit=i,this.startAt=s,this.endAt=o,this.ue=null}}function tw(t,e=null,n=[],r=[],a=null,i=null,s=null){return new ZU(t,e,n,r,a,i,s)}function kE(t){const e=Qe(t);if(e.ue===null){let n=e.path.canonicalString();e.collectionGroup!==null&&(n+="|cg:"+e.collectionGroup),n+="|f:",n+=e.filters.map(r=>z1(r)).join(","),n+="|ob:",n+=e.orderBy.map(r=>function(i){return i.field.canonicalString()+i.dir}(r)).join(","),cm(e.limit)||(n+="|l:",n+=e.limit),e.startAt&&(n+="|lb:",n+=e.startAt.inclusive?"b:":"a:",n+=e.startAt.position.map(r=>ru(r)).join(",")),e.endAt&&(n+="|ub:",n+=e.endAt.inclusive?"a:":"b:",n+=e.endAt.position.map(r=>ru(r)).join(",")),e.ue=n}return e.ue}function NE(t,e){if(t.limit!==e.limit||t.orderBy.length!==e.orderBy.length)return!1;for(let n=0;n0?e.explicitOrderBy[e.explicitOrderBy.length-1].dir:"asc";(function(s){let o=new wn(Wn.comparator);return s.filters.forEach(l=>{l.getFlattenedFilters().forEach(u=>{u.isInequality()&&(o=o.add(u.field))})}),o})(e).forEach(i=>{n.has(i.canonicalString())||i.isKeyField()||e.ce.push(new Xp(i,r))}),n.has(Wn.keyField().canonicalString())||e.ce.push(new Xp(Wn.keyField(),r))}return e.ce}function Pa(t){const e=Qe(t);return e.le||(e.le=nV(e,Fc(t))),e.le}function nV(t,e){if(t.limitType==="F")return tw(t.path,t.collectionGroup,e,t.filters,t.limit,t.startAt,t.endAt);{e=e.map(a=>{const i=a.dir==="desc"?"asc":"desc";return new Xp(a.field,i)});const n=t.endAt?new Yp(t.endAt.position,t.endAt.inclusive):null,r=t.startAt?new Yp(t.startAt.position,t.startAt.inclusive):null;return tw(t.path,t.collectionGroup,e,t.filters,t.limit,n,r)}}function G1(t,e,n){return new hm(t.path,t.collectionGroup,t.explicitOrderBy.slice(),t.filters.slice(),e,n,t.startAt,t.endAt)}function fm(t,e){return NE(Pa(t),Pa(e))&&t.limitType===e.limitType}function x4(t){return`${kE(Pa(t))}|lt:${t.limitType}`}function nl(t){return`Query(target=${function(n){let r=n.path.canonicalString();return n.collectionGroup!==null&&(r+=" collectionGroup="+n.collectionGroup),n.filters.length>0&&(r+=`, filters: [${n.filters.map(a=>E4(a)).join(", ")}]`),cm(n.limit)||(r+=", limit: "+n.limit),n.orderBy.length>0&&(r+=`, orderBy: [${n.orderBy.map(a=>function(s){return`${s.field.canonicalString()} (${s.dir})`}(a)).join(", ")}]`),n.startAt&&(r+=", startAt: ",r+=n.startAt.inclusive?"b:":"a:",r+=n.startAt.position.map(a=>ru(a)).join(",")),n.endAt&&(r+=", endAt: ",r+=n.endAt.inclusive?"a:":"b:",r+=n.endAt.position.map(a=>ru(a)).join(",")),`Target(${r})`}(Pa(t))}; limitType=${t.limitType})`}function pm(t,e){return e.isFoundDocument()&&function(r,a){const i=a.key.path;return r.collectionGroup!==null?a.key.hasCollectionId(r.collectionGroup)&&r.path.isPrefixOf(i):Ne.isDocumentKey(r.path)?r.path.isEqual(i):r.path.isImmediateParentOf(i)}(t,e)&&function(r,a){for(const i of Fc(r))if(!i.field.isKeyField()&&a.data.field(i.field)===null)return!1;return!0}(t,e)&&function(r,a){for(const i of r.filters)if(!i.matches(a))return!1;return!0}(t,e)&&function(r,a){return!(r.startAt&&!function(s,o,l){const u=ZT(s,o,l);return s.inclusive?u<=0:u<0}(r.startAt,Fc(r),a)||r.endAt&&!function(s,o,l){const u=ZT(s,o,l);return s.inclusive?u>=0:u>0}(r.endAt,Fc(r),a))}(t,e)}function rV(t){return t.collectionGroup||(t.path.length%2==1?t.path.lastSegment():t.path.get(t.path.length-2))}function S4(t){return(e,n)=>{let r=!1;for(const a of Fc(t)){const i=aV(a,e,n);if(i!==0)return i;r=r||a.field.isKeyField()}return 0}}function aV(t,e,n){const r=t.field.isKeyField()?Ne.comparator(e.key,n.key):function(i,s,o){const l=s.data.field(i),u=o.data.field(i);return l!==null&&u!==null?nu(l,u):ze()}(t.field,e,n);switch(t.dir){case"asc":return r;case"desc":return-1*r;default:return ze()}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class Su{constructor(e,n){this.mapKeyFn=e,this.equalsFn=n,this.inner={},this.innerSize=0}get(e){const n=this.mapKeyFn(e),r=this.inner[n];if(r!==void 0){for(const[a,i]of r)if(this.equalsFn(a,e))return i}}has(e){return this.get(e)!==void 0}set(e,n){const r=this.mapKeyFn(e),a=this.inner[r];if(a===void 0)return this.inner[r]=[[e,n]],void this.innerSize++;for(let i=0;i{for(const[a,i]of r)e(a,i)})}isEmpty(){return UU(this.inner)}size(){return this.innerSize}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const iV=new jt(Ne.comparator);function _s(){return iV}const T4=new jt(Ne.comparator);function gc(...t){let e=T4;for(const n of t)e=e.insert(n.key,n);return e}function sV(t){let e=T4;return t.forEach((n,r)=>e=e.insert(n,r.overlayedDocument)),e}function Qs(){return Bc()}function w4(){return Bc()}function Bc(){return new Su(t=>t.toString(),(t,e)=>t.isEqual(e))}const oV=new wn(Ne.comparator);function Ze(...t){let e=oV;for(const n of t)e=e.add(n);return e}const lV=new wn(it);function uV(){return lV}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function cV(t,e){if(t.useProto3Json){if(isNaN(e))return{doubleValue:"NaN"};if(e===1/0)return{doubleValue:"Infinity"};if(e===-1/0)return{doubleValue:"-Infinity"}}return{doubleValue:U1(e)?"-0":e}}function dV(t){return{integerValue:""+t}}/** * @license * Copyright 2018 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class mm{constructor(){this._=void 0}}function hV(t,e,n){return t instanceof H1?function(a,i){const s={fields:{__type__:{stringValue:"server_timestamp"},__local_write_time__:{timestampValue:{seconds:a.seconds,nanos:a.nanoseconds}}}};return i&&IE(i)&&(i=PE(i)),i&&(s.fields.__previous_value__=i),{mapValue:s}}(n,e):t instanceof Qp?C4(t,e):t instanceof Zp?A4(t,e):function(a,i){const s=pV(a,i),o=rw(s)+rw(a.Pe);return j1(s)&&j1(a.Pe)?dV(o):cV(a.serializer,o)}(t,e)}function fV(t,e,n){return t instanceof Qp?C4(t,e):t instanceof Zp?A4(t,e):n}function pV(t,e){return t instanceof W1?function(r){return j1(r)||function(i){return!!i&&"doubleValue"in i}(r)}(e)?e:{integerValue:0}:null}class H1 extends mm{}class Qp extends mm{constructor(e){super(),this.elements=e}}function C4(t,e){const n=I4(e);for(const r of t.elements)n.some(a=>ka(a,r))||n.push(r);return{arrayValue:{values:n}}}class Zp extends mm{constructor(e){super(),this.elements=e}}function A4(t,e){let n=I4(e);for(const r of t.elements)n=n.filter(a=>!ka(a,r));return{arrayValue:{values:n}}}class W1 extends mm{constructor(e,n){super(),this.serializer=e,this.Pe=n}}function rw(t){return Ut(t.integerValue||t.doubleValue)}function I4(t){return RE(t)&&t.arrayValue.values?t.arrayValue.values.slice():[]}function mV(t,e){return t.field.isEqual(e.field)&&function(r,a){return r instanceof Qp&&a instanceof Qp||r instanceof Zp&&a instanceof Zp?tu(r.elements,a.elements,ka):r instanceof W1&&a instanceof W1?ka(r.Pe,a.Pe):r instanceof H1&&a instanceof H1}(t.transform,e.transform)}class io{constructor(e,n){this.updateTime=e,this.exists=n}static none(){return new io}static exists(e){return new io(void 0,e)}static updateTime(e){return new io(e)}get isNone(){return this.updateTime===void 0&&this.exists===void 0}isEqual(e){return this.exists===e.exists&&(this.updateTime?!!e.updateTime&&this.updateTime.isEqual(e.updateTime):!e.updateTime)}}function $f(t,e){return t.updateTime!==void 0?e.isFoundDocument()&&e.version.isEqual(t.updateTime):t.exists===void 0||t.exists===e.isFoundDocument()}class ME{}function P4(t,e){if(!t.hasLocalMutations||e&&e.fields.length===0)return null;if(e===null)return t.isNoDocument()?new vV(t.key,io.none()):new LE(t.key,t.data,io.none());{const n=t.data,r=Ea.empty();let a=new wn(Wn.comparator);for(let i of e.fields)if(!a.has(i)){let s=n.field(i);s===null&&i.length>1&&(i=i.popLast(),s=n.field(i)),s===null?r.delete(i):r.set(i,s),a=a.add(i)}return new gm(t.key,r,new qi(a.toArray()),io.none())}}function gV(t,e,n){t instanceof LE?function(a,i,s){const o=a.value.clone(),l=iw(a.fieldTransforms,i,s.transformResults);o.setAll(l),i.convertToFoundDocument(s.version,o).setHasCommittedMutations()}(t,e,n):t instanceof gm?function(a,i,s){if(!$f(a.precondition,i))return void i.convertToUnknownDocument(s.version);const o=iw(a.fieldTransforms,i,s.transformResults),l=i.data;l.setAll(R4(a)),l.setAll(o),i.convertToFoundDocument(s.version,l).setHasCommittedMutations()}(t,e,n):function(a,i,s){i.convertToNoDocument(s.version).setHasCommittedMutations()}(0,e,n)}function Uc(t,e,n,r){return t instanceof LE?function(i,s,o,l){if(!$f(i.precondition,s))return o;const u=i.value.clone(),c=sw(i.fieldTransforms,l,s);return u.setAll(c),s.convertToFoundDocument(s.version,u).setHasLocalMutations(),null}(t,e,n,r):t instanceof gm?function(i,s,o,l){if(!$f(i.precondition,s))return o;const u=sw(i.fieldTransforms,l,s),c=s.data;return c.setAll(R4(i)),c.setAll(u),s.convertToFoundDocument(s.version,c).setHasLocalMutations(),o===null?null:o.unionWith(i.fieldMask.fields).unionWith(i.fieldTransforms.map(h=>h.field))}(t,e,n,r):function(i,s,o){return $f(i.precondition,s)?(s.convertToNoDocument(s.version).setHasLocalMutations(),null):o}(t,e,n)}function aw(t,e){return t.type===e.type&&!!t.key.isEqual(e.key)&&!!t.precondition.isEqual(e.precondition)&&!!function(r,a){return r===void 0&&a===void 0||!(!r||!a)&&tu(r,a,(i,s)=>mV(i,s))}(t.fieldTransforms,e.fieldTransforms)&&(t.type===0?t.value.isEqual(e.value):t.type!==1||t.data.isEqual(e.data)&&t.fieldMask.isEqual(e.fieldMask))}class LE extends ME{constructor(e,n,r,a=[]){super(),this.key=e,this.value=n,this.precondition=r,this.fieldTransforms=a,this.type=0}getFieldMask(){return null}}class gm extends ME{constructor(e,n,r,a,i=[]){super(),this.key=e,this.data=n,this.fieldMask=r,this.precondition=a,this.fieldTransforms=i,this.type=1}getFieldMask(){return this.fieldMask}}function R4(t){const e=new Map;return t.fieldMask.fields.forEach(n=>{if(!n.isEmpty()){const r=t.data.field(n);e.set(n,r)}}),e}function iw(t,e,n){const r=new Map;$t(t.length===n.length);for(let a=0;a{const i=e.get(a.key),s=i.overlayedDocument;let o=this.applyToLocalView(s,i.mutatedFields);o=n.has(a.key)?null:o;const l=P4(s,o);l!==null&&r.set(a.key,l),s.isValidDocument()||s.convertToNoDocument(Fe.min())}),r}keys(){return this.mutations.reduce((e,n)=>e.add(n.key),Ze())}isEqual(e){return this.batchId===e.batchId&&tu(this.mutations,e.mutations,(n,r)=>aw(n,r))&&tu(this.baseMutations,e.baseMutations,(n,r)=>aw(n,r))}}/** * @license * Copyright 2022 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class yV{constructor(e,n){this.largestBatchId=e,this.mutation=n}getKey(){return this.mutation.key}isEqual(e){return e!==null&&this.mutation===e.mutation}toString(){return`Overlay{ largestBatchId: ${this.largestBatchId}, mutation: ${this.mutation.toString()} }`}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class EV{constructor(e,n){this.count=e,this.unchangedNames=n}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */var Gt,Xe;function k4(t){if(t===void 0)return di("GRPC error has no .code"),ve.UNKNOWN;switch(t){case Gt.OK:return ve.OK;case Gt.CANCELLED:return ve.CANCELLED;case Gt.UNKNOWN:return ve.UNKNOWN;case Gt.DEADLINE_EXCEEDED:return ve.DEADLINE_EXCEEDED;case Gt.RESOURCE_EXHAUSTED:return ve.RESOURCE_EXHAUSTED;case Gt.INTERNAL:return ve.INTERNAL;case Gt.UNAVAILABLE:return ve.UNAVAILABLE;case Gt.UNAUTHENTICATED:return ve.UNAUTHENTICATED;case Gt.INVALID_ARGUMENT:return ve.INVALID_ARGUMENT;case Gt.NOT_FOUND:return ve.NOT_FOUND;case Gt.ALREADY_EXISTS:return ve.ALREADY_EXISTS;case Gt.PERMISSION_DENIED:return ve.PERMISSION_DENIED;case Gt.FAILED_PRECONDITION:return ve.FAILED_PRECONDITION;case Gt.ABORTED:return ve.ABORTED;case Gt.OUT_OF_RANGE:return ve.OUT_OF_RANGE;case Gt.UNIMPLEMENTED:return ve.UNIMPLEMENTED;case Gt.DATA_LOSS:return ve.DATA_LOSS;default:return ze()}}(Xe=Gt||(Gt={}))[Xe.OK=0]="OK",Xe[Xe.CANCELLED=1]="CANCELLED",Xe[Xe.UNKNOWN=2]="UNKNOWN",Xe[Xe.INVALID_ARGUMENT=3]="INVALID_ARGUMENT",Xe[Xe.DEADLINE_EXCEEDED=4]="DEADLINE_EXCEEDED",Xe[Xe.NOT_FOUND=5]="NOT_FOUND",Xe[Xe.ALREADY_EXISTS=6]="ALREADY_EXISTS",Xe[Xe.PERMISSION_DENIED=7]="PERMISSION_DENIED",Xe[Xe.UNAUTHENTICATED=16]="UNAUTHENTICATED",Xe[Xe.RESOURCE_EXHAUSTED=8]="RESOURCE_EXHAUSTED",Xe[Xe.FAILED_PRECONDITION=9]="FAILED_PRECONDITION",Xe[Xe.ABORTED=10]="ABORTED",Xe[Xe.OUT_OF_RANGE=11]="OUT_OF_RANGE",Xe[Xe.UNIMPLEMENTED=12]="UNIMPLEMENTED",Xe[Xe.INTERNAL=13]="INTERNAL",Xe[Xe.UNAVAILABLE=14]="UNAVAILABLE",Xe[Xe.DATA_LOSS=15]="DATA_LOSS";/** * @license * Copyright 2023 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function bV(){return new TextEncoder}/** * @license * Copyright 2022 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const xV=new ro([4294967295,4294967295],0);function ow(t){const e=bV().encode(t),n=new s4;return n.update(e),new Uint8Array(n.digest())}function lw(t){const e=new DataView(t.buffer),n=e.getUint32(0,!0),r=e.getUint32(4,!0),a=e.getUint32(8,!0),i=e.getUint32(12,!0);return[new ro([n,r],0),new ro([a,i],0)]}class DE{constructor(e,n,r){if(this.bitmap=e,this.padding=n,this.hashCount=r,n<0||n>=8)throw new vc(`Invalid padding: ${n}`);if(r<0)throw new vc(`Invalid hash count: ${r}`);if(e.length>0&&this.hashCount===0)throw new vc(`Invalid hash count: ${r}`);if(e.length===0&&n!==0)throw new vc(`Invalid padding when bitmap length is 0: ${n}`);this.Ie=8*e.length-n,this.Te=ro.fromNumber(this.Ie)}Ee(e,n,r){let a=e.add(n.multiply(ro.fromNumber(r)));return a.compare(xV)===1&&(a=new ro([a.getBits(0),a.getBits(1)],0)),a.modulo(this.Te).toNumber()}de(e){return(this.bitmap[Math.floor(e/8)]&1<s.insert(o)),s}insert(e){if(this.Ie===0)return;const n=ow(e),[r,a]=lw(n);for(let i=0;i0&&(this.we=!0,this.pe=e)}ve(){let e=Ze(),n=Ze(),r=Ze();return this.ge.forEach((a,i)=>{switch(i){case 0:e=e.add(a);break;case 2:n=n.add(a);break;case 1:r=r.add(a);break;default:ze()}}),new hh(this.pe,this.ye,e,n,r)}Ce(){this.we=!1,this.ge=dw()}Fe(e,n){this.we=!0,this.ge=this.ge.insert(e,n)}Me(e){this.we=!0,this.ge=this.ge.remove(e)}xe(){this.fe+=1}Oe(){this.fe-=1,$t(this.fe>=0)}Ne(){this.we=!0,this.ye=!0}}class SV{constructor(e){this.Le=e,this.Be=new Map,this.ke=_s(),this.qe=cw(),this.Qe=new jt(it)}Ke(e){for(const n of e.Re)e.Ve&&e.Ve.isFoundDocument()?this.$e(n,e.Ve):this.Ue(n,e.key,e.Ve);for(const n of e.removedTargetIds)this.Ue(n,e.key,e.Ve)}We(e){this.forEachTarget(e,n=>{const r=this.Ge(n);switch(e.state){case 0:this.ze(n)&&r.De(e.resumeToken);break;case 1:r.Oe(),r.Se||r.Ce(),r.De(e.resumeToken);break;case 2:r.Oe(),r.Se||this.removeTarget(n);break;case 3:this.ze(n)&&(r.Ne(),r.De(e.resumeToken));break;case 4:this.ze(n)&&(this.je(n),r.De(e.resumeToken));break;default:ze()}})}forEachTarget(e,n){e.targetIds.length>0?e.targetIds.forEach(n):this.Be.forEach((r,a)=>{this.ze(a)&&n(a)})}He(e){const n=e.targetId,r=e.me.count,a=this.Je(n);if(a){const i=a.target;if(q1(i))if(r===0){const s=new Ne(i.path);this.Ue(n,s,Bn.newNoDocument(s,Fe.min()))}else $t(r===1);else{const s=this.Ye(n);if(s!==r){const o=this.Ze(e),l=o?this.Xe(o,e,s):1;if(l!==0){this.je(n);const u=l===2?"TargetPurposeExistenceFilterMismatchBloom":"TargetPurposeExistenceFilterMismatch";this.Qe=this.Qe.insert(n,u)}}}}}Ze(e){const n=e.me.unchangedNames;if(!n||!n.bits)return null;const{bits:{bitmap:r="",padding:a=0},hashCount:i=0}=n;let s,o;try{s=So(r).toUint8Array()}catch(l){if(l instanceof m4)return eu("Decoding the base64 bloom filter in existence filter failed ("+l.message+"); ignoring the bloom filter and falling back to full re-query."),null;throw l}try{o=new DE(s,a,i)}catch(l){return eu(l instanceof vc?"BloomFilter error: ":"Applying bloom filter failed: ",l),null}return o.Ie===0?null:o}Xe(e,n,r){return n.me.count===r-this.nt(e,n.targetId)?0:2}nt(e,n){const r=this.Le.getRemoteKeysForTarget(n);let a=0;return r.forEach(i=>{const s=this.Le.tt(),o=`projects/${s.projectId}/databases/${s.database}/documents/${i.path.canonicalString()}`;e.mightContain(o)||(this.Ue(n,i,null),a++)}),a}rt(e){const n=new Map;this.Be.forEach((i,s)=>{const o=this.Je(s);if(o){if(i.current&&q1(o.target)){const l=new Ne(o.target.path);this.ke.get(l)!==null||this.it(s,l)||this.Ue(s,l,Bn.newNoDocument(l,e))}i.be&&(n.set(s,i.ve()),i.Ce())}});let r=Ze();this.qe.forEach((i,s)=>{let o=!0;s.forEachWhile(l=>{const u=this.Je(l);return!u||u.purpose==="TargetPurposeLimboResolution"||(o=!1,!1)}),o&&(r=r.add(i))}),this.ke.forEach((i,s)=>s.setReadTime(e));const a=new vm(e,n,this.Qe,this.ke,r);return this.ke=_s(),this.qe=cw(),this.Qe=new jt(it),a}$e(e,n){if(!this.ze(e))return;const r=this.it(e,n.key)?2:0;this.Ge(e).Fe(n.key,r),this.ke=this.ke.insert(n.key,n),this.qe=this.qe.insert(n.key,this.st(n.key).add(e))}Ue(e,n,r){if(!this.ze(e))return;const a=this.Ge(e);this.it(e,n)?a.Fe(n,1):a.Me(n),this.qe=this.qe.insert(n,this.st(n).delete(e)),r&&(this.ke=this.ke.insert(n,r))}removeTarget(e){this.Be.delete(e)}Ye(e){const n=this.Ge(e).ve();return this.Le.getRemoteKeysForTarget(e).size+n.addedDocuments.size-n.removedDocuments.size}xe(e){this.Ge(e).xe()}Ge(e){let n=this.Be.get(e);return n||(n=new uw,this.Be.set(e,n)),n}st(e){let n=this.qe.get(e);return n||(n=new wn(it),this.qe=this.qe.insert(e,n)),n}ze(e){const n=this.Je(e)!==null;return n||Ce("WatchChangeAggregator","Detected inactive target",e),n}Je(e){const n=this.Be.get(e);return n&&n.Se?null:this.Le.ot(e)}je(e){this.Be.set(e,new uw),this.Le.getRemoteKeysForTarget(e).forEach(n=>{this.Ue(e,n,null)})}it(e,n){return this.Le.getRemoteKeysForTarget(e).has(n)}}function cw(){return new jt(Ne.comparator)}function dw(){return new jt(Ne.comparator)}const TV={asc:"ASCENDING",desc:"DESCENDING"},wV={"<":"LESS_THAN","<=":"LESS_THAN_OR_EQUAL",">":"GREATER_THAN",">=":"GREATER_THAN_OR_EQUAL","==":"EQUAL","!=":"NOT_EQUAL","array-contains":"ARRAY_CONTAINS",in:"IN","not-in":"NOT_IN","array-contains-any":"ARRAY_CONTAINS_ANY"},CV={and:"AND",or:"OR"};class AV{constructor(e,n){this.databaseId=e,this.useProto3Json=n}}function $1(t,e){return t.useProto3Json||cm(e)?e:{value:e}}function IV(t,e){return t.useProto3Json?`${new Date(1e3*e.seconds).toISOString().replace(/\.\d*/,"").replace("Z","")}.${("000000000"+e.nanoseconds).slice(-9)}Z`:{seconds:""+e.seconds,nanos:e.nanoseconds}}function PV(t,e){return t.useProto3Json?e.toBase64():e.toUint8Array()}function Ml(t){return $t(!!t),Fe.fromTimestamp(function(n){const r=vs(n);return new or(r.seconds,r.nanos)}(t))}function RV(t,e){return K1(t,e).canonicalString()}function K1(t,e){const n=function(a){return new Ft(["projects",a.projectId,"databases",a.database])}(t).child("documents");return e===void 0?n:n.child(e)}function M4(t){const e=Ft.fromString(t);return $t(U4(e)),e}function qg(t,e){const n=M4(e);if(n.get(1)!==t.databaseId.projectId)throw new ke(ve.INVALID_ARGUMENT,"Tried to deserialize key from different project: "+n.get(1)+" vs "+t.databaseId.projectId);if(n.get(3)!==t.databaseId.database)throw new ke(ve.INVALID_ARGUMENT,"Tried to deserialize key from different database: "+n.get(3)+" vs "+t.databaseId.database);return new Ne(D4(n))}function L4(t,e){return RV(t.databaseId,e)}function kV(t){const e=M4(t);return e.length===4?Ft.emptyPath():D4(e)}function hw(t){return new Ft(["projects",t.databaseId.projectId,"databases",t.databaseId.database]).canonicalString()}function D4(t){return $t(t.length>4&&t.get(4)==="documents"),t.popFirst(5)}function NV(t,e){let n;if("targetChange"in e){e.targetChange;const r=function(u){return u==="NO_CHANGE"?0:u==="ADD"?1:u==="REMOVE"?2:u==="CURRENT"?3:u==="RESET"?4:ze()}(e.targetChange.targetChangeType||"NO_CHANGE"),a=e.targetChange.targetIds||[],i=function(u,c){return u.useProto3Json?($t(c===void 0||typeof c=="string"),In.fromBase64String(c||"")):($t(c===void 0||c instanceof Buffer||c instanceof Uint8Array),In.fromUint8Array(c||new Uint8Array))}(t,e.targetChange.resumeToken),s=e.targetChange.cause,o=s&&function(u){const c=u.code===void 0?ve.UNKNOWN:k4(u.code);return new ke(c,u.message||"")}(s);n=new O4(r,a,i,o||null)}else if("documentChange"in e){e.documentChange;const r=e.documentChange;r.document,r.document.name,r.document.updateTime;const a=qg(t,r.document.name),i=Ml(r.document.updateTime),s=r.document.createTime?Ml(r.document.createTime):Fe.min(),o=new Ea({mapValue:{fields:r.document.fields}}),l=Bn.newFoundDocument(a,i,s,o),u=r.targetIds||[],c=r.removedTargetIds||[];n=new Kf(u,c,l.key,l)}else if("documentDelete"in e){e.documentDelete;const r=e.documentDelete;r.document;const a=qg(t,r.document),i=r.readTime?Ml(r.readTime):Fe.min(),s=Bn.newNoDocument(a,i),o=r.removedTargetIds||[];n=new Kf([],o,s.key,s)}else if("documentRemove"in e){e.documentRemove;const r=e.documentRemove;r.document;const a=qg(t,r.document),i=r.removedTargetIds||[];n=new Kf([],i,a,null)}else{if(!("filter"in e))return ze();{e.filter;const r=e.filter;r.targetId;const{count:a=0,unchangedNames:i}=r,s=new EV(a,i),o=r.targetId;n=new N4(o,s)}}return n}function OV(t,e){return{documents:[L4(t,e.path)]}}function MV(t,e){const n={structuredQuery:{}},r=e.path;let a;e.collectionGroup!==null?(a=r,n.structuredQuery.from=[{collectionId:e.collectionGroup,allDescendants:!0}]):(a=r.popLast(),n.structuredQuery.from=[{collectionId:r.lastSegment()}]),n.parent=L4(t,a);const i=function(u){if(u.length!==0)return B4(Na.create(u,"and"))}(e.filters);i&&(n.structuredQuery.where=i);const s=function(u){if(u.length!==0)return u.map(c=>function(f){return{field:rl(f.field),direction:FV(f.dir)}}(c))}(e.orderBy);s&&(n.structuredQuery.orderBy=s);const o=$1(t,e.limit);return o!==null&&(n.structuredQuery.limit=o),e.startAt&&(n.structuredQuery.startAt=function(u){return{before:u.inclusive,values:u.position}}(e.startAt)),e.endAt&&(n.structuredQuery.endAt=function(u){return{before:!u.inclusive,values:u.position}}(e.endAt)),{_t:n,parent:a}}function LV(t){let e=kV(t.parent);const n=t.structuredQuery,r=n.from?n.from.length:0;let a=null;if(r>0){$t(r===1);const c=n.from[0];c.allDescendants?a=c.collectionId:e=e.child(c.collectionId)}let i=[];n.where&&(i=function(h){const f=F4(h);return f instanceof Na&&_4(f)?f.getFilters():[f]}(n.where));let s=[];n.orderBy&&(s=function(h){return h.map(f=>function(g){return new Xp(al(g.field),function(_){switch(_){case"ASCENDING":return"asc";case"DESCENDING":return"desc";default:return}}(g.direction))}(f))}(n.orderBy));let o=null;n.limit&&(o=function(h){let f;return f=typeof h=="object"?h.value:h,cm(f)?null:f}(n.limit));let l=null;n.startAt&&(l=function(h){const f=!!h.before,p=h.values||[];return new Yp(p,f)}(n.startAt));let u=null;return n.endAt&&(u=function(h){const f=!h.before,p=h.values||[];return new Yp(p,f)}(n.endAt)),eV(e,a,s,i,o,"F",l,u)}function DV(t,e){const n=function(a){switch(a){case"TargetPurposeListen":return null;case"TargetPurposeExistenceFilterMismatch":return"existence-filter-mismatch";case"TargetPurposeExistenceFilterMismatchBloom":return"existence-filter-mismatch-bloom";case"TargetPurposeLimboResolution":return"limbo-document";default:return ze()}}(e.purpose);return n==null?null:{"goog-listen-tags":n}}function F4(t){return t.unaryFilter!==void 0?function(n){switch(n.unaryFilter.op){case"IS_NAN":const r=al(n.unaryFilter.field);return rn.create(r,"==",{doubleValue:NaN});case"IS_NULL":const a=al(n.unaryFilter.field);return rn.create(a,"==",{nullValue:"NULL_VALUE"});case"IS_NOT_NAN":const i=al(n.unaryFilter.field);return rn.create(i,"!=",{doubleValue:NaN});case"IS_NOT_NULL":const s=al(n.unaryFilter.field);return rn.create(s,"!=",{nullValue:"NULL_VALUE"});default:return ze()}}(t):t.fieldFilter!==void 0?function(n){return rn.create(al(n.fieldFilter.field),function(a){switch(a){case"EQUAL":return"==";case"NOT_EQUAL":return"!=";case"GREATER_THAN":return">";case"GREATER_THAN_OR_EQUAL":return">=";case"LESS_THAN":return"<";case"LESS_THAN_OR_EQUAL":return"<=";case"ARRAY_CONTAINS":return"array-contains";case"IN":return"in";case"NOT_IN":return"not-in";case"ARRAY_CONTAINS_ANY":return"array-contains-any";default:return ze()}}(n.fieldFilter.op),n.fieldFilter.value)}(t):t.compositeFilter!==void 0?function(n){return Na.create(n.compositeFilter.filters.map(r=>F4(r)),function(a){switch(a){case"AND":return"and";case"OR":return"or";default:return ze()}}(n.compositeFilter.op))}(t):ze()}function FV(t){return TV[t]}function BV(t){return wV[t]}function UV(t){return CV[t]}function rl(t){return{fieldPath:t.canonicalString()}}function al(t){return Wn.fromServerFormat(t.fieldPath)}function B4(t){return t instanceof rn?function(n){if(n.op==="=="){if(QT(n.value))return{unaryFilter:{field:rl(n.field),op:"IS_NAN"}};if(XT(n.value))return{unaryFilter:{field:rl(n.field),op:"IS_NULL"}}}else if(n.op==="!="){if(QT(n.value))return{unaryFilter:{field:rl(n.field),op:"IS_NOT_NAN"}};if(XT(n.value))return{unaryFilter:{field:rl(n.field),op:"IS_NOT_NULL"}}}return{fieldFilter:{field:rl(n.field),op:BV(n.op),value:n.value}}}(t):t instanceof Na?function(n){const r=n.getFilters().map(a=>B4(a));return r.length===1?r[0]:{compositeFilter:{op:UV(n.op),filters:r}}}(t):ze()}function U4(t){return t.length>=4&&t.get(0)==="projects"&&t.get(2)==="databases"}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class Gi{constructor(e,n,r,a,i=Fe.min(),s=Fe.min(),o=In.EMPTY_BYTE_STRING,l=null){this.target=e,this.targetId=n,this.purpose=r,this.sequenceNumber=a,this.snapshotVersion=i,this.lastLimboFreeSnapshotVersion=s,this.resumeToken=o,this.expectedCount=l}withSequenceNumber(e){return new Gi(this.target,this.targetId,this.purpose,e,this.snapshotVersion,this.lastLimboFreeSnapshotVersion,this.resumeToken,this.expectedCount)}withResumeToken(e,n){return new Gi(this.target,this.targetId,this.purpose,this.sequenceNumber,n,this.lastLimboFreeSnapshotVersion,e,null)}withExpectedCount(e){return new Gi(this.target,this.targetId,this.purpose,this.sequenceNumber,this.snapshotVersion,this.lastLimboFreeSnapshotVersion,this.resumeToken,e)}withLastLimboFreeSnapshotVersion(e){return new Gi(this.target,this.targetId,this.purpose,this.sequenceNumber,this.snapshotVersion,e,this.resumeToken,this.expectedCount)}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class VV{constructor(e){this.ct=e}}function jV(t){const e=LV({parent:t.parent,structuredQuery:t.structuredQuery});return t.limitType==="LAST"?G1(e,e.limit,"L"):e}/** * @license * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class zV{constructor(){this.un=new qV}addToCollectionParentIndex(e,n){return this.un.add(n),ie.resolve()}getCollectionParents(e,n){return ie.resolve(this.un.getEntries(n))}addFieldIndex(e,n){return ie.resolve()}deleteFieldIndex(e,n){return ie.resolve()}deleteAllFieldIndexes(e){return ie.resolve()}createTargetIndexes(e,n){return ie.resolve()}getDocumentsMatchingTarget(e,n){return ie.resolve(null)}getIndexType(e,n){return ie.resolve(0)}getFieldIndexes(e,n){return ie.resolve([])}getNextCollectionGroupToUpdate(e){return ie.resolve(null)}getMinOffset(e,n){return ie.resolve(gs.min())}getMinOffsetFromCollectionGroup(e,n){return ie.resolve(gs.min())}updateCollectionGroup(e,n,r){return ie.resolve()}updateIndexEntries(e,n){return ie.resolve()}}class qV{constructor(){this.index={}}add(e){const n=e.lastSegment(),r=e.popLast(),a=this.index[n]||new wn(Ft.comparator),i=!a.has(r);return this.index[n]=a.add(r),i}has(e){const n=e.lastSegment(),r=e.popLast(),a=this.index[n];return a&&a.has(r)}getEntries(e){return(this.index[e]||new wn(Ft.comparator)).toArray()}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class au{constructor(e){this.Ln=e}next(){return this.Ln+=2,this.Ln}static Bn(){return new au(0)}static kn(){return new au(-1)}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class GV{constructor(){this.changes=new Su(e=>e.toString(),(e,n)=>e.isEqual(n)),this.changesApplied=!1}addEntry(e){this.assertNotApplied(),this.changes.set(e.key,e)}removeEntry(e,n){this.assertNotApplied(),this.changes.set(e,Bn.newInvalidDocument(e).setReadTime(n))}getEntry(e,n){this.assertNotApplied();const r=this.changes.get(n);return r!==void 0?ie.resolve(r):this.getFromCache(e,n)}getEntries(e,n){return this.getAllFromCache(e,n)}apply(e){return this.assertNotApplied(),this.changesApplied=!0,this.applyChanges(e)}assertNotApplied(){}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. *//** * @license * Copyright 2022 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class HV{constructor(e,n){this.overlayedDocument=e,this.mutatedFields=n}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class WV{constructor(e,n,r,a){this.remoteDocumentCache=e,this.mutationQueue=n,this.documentOverlayCache=r,this.indexManager=a}getDocument(e,n){let r=null;return this.documentOverlayCache.getOverlay(e,n).next(a=>(r=a,this.remoteDocumentCache.getEntry(e,n))).next(a=>(r!==null&&Uc(r.mutation,a,qi.empty(),or.now()),a))}getDocuments(e,n){return this.remoteDocumentCache.getEntries(e,n).next(r=>this.getLocalViewOfDocuments(e,r,Ze()).next(()=>r))}getLocalViewOfDocuments(e,n,r=Ze()){const a=Qs();return this.populateOverlays(e,a,n).next(()=>this.computeViews(e,n,a,r).next(i=>{let s=gc();return i.forEach((o,l)=>{s=s.insert(o,l.overlayedDocument)}),s}))}getOverlayedDocuments(e,n){const r=Qs();return this.populateOverlays(e,r,n).next(()=>this.computeViews(e,n,r,Ze()))}populateOverlays(e,n,r){const a=[];return r.forEach(i=>{n.has(i)||a.push(i)}),this.documentOverlayCache.getOverlays(e,a).next(i=>{i.forEach((s,o)=>{n.set(s,o)})})}computeViews(e,n,r,a){let i=_s();const s=Bc(),o=function(){return Bc()}();return n.forEach((l,u)=>{const c=r.get(u.key);a.has(u.key)&&(c===void 0||c.mutation instanceof gm)?i=i.insert(u.key,u):c!==void 0?(s.set(u.key,c.mutation.getFieldMask()),Uc(c.mutation,u,c.mutation.getFieldMask(),or.now())):s.set(u.key,qi.empty())}),this.recalculateAndSaveOverlays(e,i).next(l=>(l.forEach((u,c)=>s.set(u,c)),n.forEach((u,c)=>{var h;return o.set(u,new HV(c,(h=s.get(u))!==null&&h!==void 0?h:null))}),o))}recalculateAndSaveOverlays(e,n){const r=Bc();let a=new jt((s,o)=>s-o),i=Ze();return this.mutationQueue.getAllMutationBatchesAffectingDocumentKeys(e,n).next(s=>{for(const o of s)o.keys().forEach(l=>{const u=n.get(l);if(u===null)return;let c=r.get(l)||qi.empty();c=o.applyToLocalView(u,c),r.set(l,c);const h=(a.get(o.batchId)||Ze()).add(l);a=a.insert(o.batchId,h)})}).next(()=>{const s=[],o=a.getReverseIterator();for(;o.hasNext();){const l=o.getNext(),u=l.key,c=l.value,h=w4();c.forEach(f=>{if(!i.has(f)){const p=P4(n.get(f),r.get(f));p!==null&&h.set(f,p),i=i.add(f)}}),s.push(this.documentOverlayCache.saveOverlays(e,u,h))}return ie.waitFor(s)}).next(()=>r)}recalculateAndSaveOverlaysForDocumentKeys(e,n){return this.remoteDocumentCache.getEntries(e,n).next(r=>this.recalculateAndSaveOverlays(e,r))}getDocumentsMatchingQuery(e,n,r,a){return function(s){return Ne.isDocumentKey(s.path)&&s.collectionGroup===null&&s.filters.length===0}(n)?this.getDocumentsMatchingDocumentQuery(e,n.path):tV(n)?this.getDocumentsMatchingCollectionGroupQuery(e,n,r,a):this.getDocumentsMatchingCollectionQuery(e,n,r,a)}getNextDocuments(e,n,r,a){return this.remoteDocumentCache.getAllFromCollectionGroup(e,n,r,a).next(i=>{const s=a-i.size>0?this.documentOverlayCache.getOverlaysForCollectionGroup(e,n,r.largestBatchId,a-i.size):ie.resolve(Qs());let o=-1,l=i;return s.next(u=>ie.forEach(u,(c,h)=>(o{l=l.insert(c,f)}))).next(()=>this.populateOverlays(e,u,i)).next(()=>this.computeViews(e,l,u,Ze())).next(c=>({batchId:o,changes:sV(c)})))})}getDocumentsMatchingDocumentQuery(e,n){return this.getDocument(e,new Ne(n)).next(r=>{let a=gc();return r.isFoundDocument()&&(a=a.insert(r.key,r)),a})}getDocumentsMatchingCollectionGroupQuery(e,n,r,a){const i=n.collectionGroup;let s=gc();return this.indexManager.getCollectionParents(e,i).next(o=>ie.forEach(o,l=>{const u=function(h,f){return new hm(f,null,h.explicitOrderBy.slice(),h.filters.slice(),h.limit,h.limitType,h.startAt,h.endAt)}(n,l.child(i));return this.getDocumentsMatchingCollectionQuery(e,u,r,a).next(c=>{c.forEach((h,f)=>{s=s.insert(h,f)})})}).next(()=>s))}getDocumentsMatchingCollectionQuery(e,n,r,a){let i;return this.documentOverlayCache.getOverlaysForCollection(e,n.path,r.largestBatchId).next(s=>(i=s,this.remoteDocumentCache.getDocumentsMatchingQuery(e,n,r,i,a))).next(s=>{i.forEach((l,u)=>{const c=u.getKey();s.get(c)===null&&(s=s.insert(c,Bn.newInvalidDocument(c)))});let o=gc();return s.forEach((l,u)=>{const c=i.get(l);c!==void 0&&Uc(c.mutation,u,qi.empty(),or.now()),pm(n,u)&&(o=o.insert(l,u))}),o})}}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class $V{constructor(e){this.serializer=e,this.hr=new Map,this.Pr=new Map}getBundleMetadata(e,n){return ie.resolve(this.hr.get(n))}saveBundleMetadata(e,n){return this.hr.set(n.id,function(a){return{id:a.id,version:a.version,createTime:Ml(a.createTime)}}(n)),ie.resolve()}getNamedQuery(e,n){return ie.resolve(this.Pr.get(n))}saveNamedQuery(e,n){return this.Pr.set(n.name,function(a){return{name:a.name,query:jV(a.bundledQuery),readTime:Ml(a.readTime)}}(n)),ie.resolve()}}/** * @license * Copyright 2022 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class KV{constructor(){this.overlays=new jt(Ne.comparator),this.Ir=new Map}getOverlay(e,n){return ie.resolve(this.overlays.get(n))}getOverlays(e,n){const r=Qs();return ie.forEach(n,a=>this.getOverlay(e,a).next(i=>{i!==null&&r.set(a,i)})).next(()=>r)}saveOverlays(e,n,r){return r.forEach((a,i)=>{this.ht(e,n,i)}),ie.resolve()}removeOverlaysForBatchId(e,n,r){const a=this.Ir.get(r);return a!==void 0&&(a.forEach(i=>this.overlays=this.overlays.remove(i)),this.Ir.delete(r)),ie.resolve()}getOverlaysForCollection(e,n,r){const a=Qs(),i=n.length+1,s=new Ne(n.child("")),o=this.overlays.getIteratorFrom(s);for(;o.hasNext();){const l=o.getNext().value,u=l.getKey();if(!n.isPrefixOf(u.path))break;u.path.length===i&&l.largestBatchId>r&&a.set(l.getKey(),l)}return ie.resolve(a)}getOverlaysForCollectionGroup(e,n,r,a){let i=new jt((u,c)=>u-c);const s=this.overlays.getIterator();for(;s.hasNext();){const u=s.getNext().value;if(u.getKey().getCollectionGroup()===n&&u.largestBatchId>r){let c=i.get(u.largestBatchId);c===null&&(c=Qs(),i=i.insert(u.largestBatchId,c)),c.set(u.getKey(),u)}}const o=Qs(),l=i.getIterator();for(;l.hasNext()&&(l.getNext().value.forEach((u,c)=>o.set(u,c)),!(o.size()>=a)););return ie.resolve(o)}ht(e,n,r){const a=this.overlays.get(r.key);if(a!==null){const s=this.Ir.get(a.largestBatchId).delete(r.key);this.Ir.set(a.largestBatchId,s)}this.overlays=this.overlays.insert(r.key,new yV(n,r));let i=this.Ir.get(n);i===void 0&&(i=Ze(),this.Ir.set(n,i)),this.Ir.set(n,i.add(r.key))}}/** * @license * Copyright 2024 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class JV{constructor(){this.sessionToken=In.EMPTY_BYTE_STRING}getSessionToken(e){return ie.resolve(this.sessionToken)}setSessionToken(e,n){return this.sessionToken=n,ie.resolve()}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class FE{constructor(){this.Tr=new wn(on.Er),this.dr=new wn(on.Ar)}isEmpty(){return this.Tr.isEmpty()}addReference(e,n){const r=new on(e,n);this.Tr=this.Tr.add(r),this.dr=this.dr.add(r)}Rr(e,n){e.forEach(r=>this.addReference(r,n))}removeReference(e,n){this.Vr(new on(e,n))}mr(e,n){e.forEach(r=>this.removeReference(r,n))}gr(e){const n=new Ne(new Ft([])),r=new on(n,e),a=new on(n,e+1),i=[];return this.dr.forEachInRange([r,a],s=>{this.Vr(s),i.push(s.key)}),i}pr(){this.Tr.forEach(e=>this.Vr(e))}Vr(e){this.Tr=this.Tr.delete(e),this.dr=this.dr.delete(e)}yr(e){const n=new Ne(new Ft([])),r=new on(n,e),a=new on(n,e+1);let i=Ze();return this.dr.forEachInRange([r,a],s=>{i=i.add(s.key)}),i}containsKey(e){const n=new on(e,0),r=this.Tr.firstAfterOrEqual(n);return r!==null&&e.isEqual(r.key)}}class on{constructor(e,n){this.key=e,this.wr=n}static Er(e,n){return Ne.comparator(e.key,n.key)||it(e.wr,n.wr)}static Ar(e,n){return it(e.wr,n.wr)||Ne.comparator(e.key,n.key)}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class YV{constructor(e,n){this.indexManager=e,this.referenceDelegate=n,this.mutationQueue=[],this.Sr=1,this.br=new wn(on.Er)}checkEmpty(e){return ie.resolve(this.mutationQueue.length===0)}addMutationBatch(e,n,r,a){const i=this.Sr;this.Sr++,this.mutationQueue.length>0&&this.mutationQueue[this.mutationQueue.length-1];const s=new _V(i,n,r,a);this.mutationQueue.push(s);for(const o of a)this.br=this.br.add(new on(o.key,i)),this.indexManager.addToCollectionParentIndex(e,o.key.path.popLast());return ie.resolve(s)}lookupMutationBatch(e,n){return ie.resolve(this.Dr(n))}getNextMutationBatchAfterBatchId(e,n){const r=n+1,a=this.vr(r),i=a<0?0:a;return ie.resolve(this.mutationQueue.length>i?this.mutationQueue[i]:null)}getHighestUnacknowledgedBatchId(){return ie.resolve(this.mutationQueue.length===0?-1:this.Sr-1)}getAllMutationBatches(e){return ie.resolve(this.mutationQueue.slice())}getAllMutationBatchesAffectingDocumentKey(e,n){const r=new on(n,0),a=new on(n,Number.POSITIVE_INFINITY),i=[];return this.br.forEachInRange([r,a],s=>{const o=this.Dr(s.wr);i.push(o)}),ie.resolve(i)}getAllMutationBatchesAffectingDocumentKeys(e,n){let r=new wn(it);return n.forEach(a=>{const i=new on(a,0),s=new on(a,Number.POSITIVE_INFINITY);this.br.forEachInRange([i,s],o=>{r=r.add(o.wr)})}),ie.resolve(this.Cr(r))}getAllMutationBatchesAffectingQuery(e,n){const r=n.path,a=r.length+1;let i=r;Ne.isDocumentKey(i)||(i=i.child(""));const s=new on(new Ne(i),0);let o=new wn(it);return this.br.forEachWhile(l=>{const u=l.key.path;return!!r.isPrefixOf(u)&&(u.length===a&&(o=o.add(l.wr)),!0)},s),ie.resolve(this.Cr(o))}Cr(e){const n=[];return e.forEach(r=>{const a=this.Dr(r);a!==null&&n.push(a)}),n}removeMutationBatch(e,n){$t(this.Fr(n.batchId,"removed")===0),this.mutationQueue.shift();let r=this.br;return ie.forEach(n.mutations,a=>{const i=new on(a.key,n.batchId);return r=r.delete(i),this.referenceDelegate.markPotentiallyOrphaned(e,a.key)}).next(()=>{this.br=r})}On(e){}containsKey(e,n){const r=new on(n,0),a=this.br.firstAfterOrEqual(r);return ie.resolve(n.isEqual(a&&a.key))}performConsistencyCheck(e){return this.mutationQueue.length,ie.resolve()}Fr(e,n){return this.vr(e)}vr(e){return this.mutationQueue.length===0?0:e-this.mutationQueue[0].batchId}Dr(e){const n=this.vr(e);return n<0||n>=this.mutationQueue.length?null:this.mutationQueue[n]}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class XV{constructor(e){this.Mr=e,this.docs=function(){return new jt(Ne.comparator)}(),this.size=0}setIndexManager(e){this.indexManager=e}addEntry(e,n){const r=n.key,a=this.docs.get(r),i=a?a.size:0,s=this.Mr(n);return this.docs=this.docs.insert(r,{document:n.mutableCopy(),size:s}),this.size+=s-i,this.indexManager.addToCollectionParentIndex(e,r.path.popLast())}removeEntry(e){const n=this.docs.get(e);n&&(this.docs=this.docs.remove(e),this.size-=n.size)}getEntry(e,n){const r=this.docs.get(n);return ie.resolve(r?r.document.mutableCopy():Bn.newInvalidDocument(n))}getEntries(e,n){let r=_s();return n.forEach(a=>{const i=this.docs.get(a);r=r.insert(a,i?i.document.mutableCopy():Bn.newInvalidDocument(a))}),ie.resolve(r)}getDocumentsMatchingQuery(e,n,r,a){let i=_s();const s=n.path,o=new Ne(s.child("")),l=this.docs.getIteratorFrom(o);for(;l.hasNext();){const{key:u,value:{document:c}}=l.getNext();if(!s.isPrefixOf(u.path))break;u.path.length>s.length+1||LU(MU(c),r)<=0||(a.has(c.key)||pm(n,c))&&(i=i.insert(c.key,c.mutableCopy()))}return ie.resolve(i)}getAllFromCollectionGroup(e,n,r,a){ze()}Or(e,n){return ie.forEach(this.docs,r=>n(r))}newChangeBuffer(e){return new QV(this)}getSize(e){return ie.resolve(this.size)}}class QV extends GV{constructor(e){super(),this.cr=e}applyChanges(e){const n=[];return this.changes.forEach((r,a)=>{a.isValidDocument()?n.push(this.cr.addEntry(e,a)):this.cr.removeEntry(r)}),ie.waitFor(n)}getFromCache(e,n){return this.cr.getEntry(e,n)}getAllFromCache(e,n){return this.cr.getEntries(e,n)}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class ZV{constructor(e){this.persistence=e,this.Nr=new Su(n=>kE(n),NE),this.lastRemoteSnapshotVersion=Fe.min(),this.highestTargetId=0,this.Lr=0,this.Br=new FE,this.targetCount=0,this.kr=au.Bn()}forEachTarget(e,n){return this.Nr.forEach((r,a)=>n(a)),ie.resolve()}getLastRemoteSnapshotVersion(e){return ie.resolve(this.lastRemoteSnapshotVersion)}getHighestSequenceNumber(e){return ie.resolve(this.Lr)}allocateTargetId(e){return this.highestTargetId=this.kr.next(),ie.resolve(this.highestTargetId)}setTargetsMetadata(e,n,r){return r&&(this.lastRemoteSnapshotVersion=r),n>this.Lr&&(this.Lr=n),ie.resolve()}Kn(e){this.Nr.set(e.target,e);const n=e.targetId;n>this.highestTargetId&&(this.kr=new au(n),this.highestTargetId=n),e.sequenceNumber>this.Lr&&(this.Lr=e.sequenceNumber)}addTargetData(e,n){return this.Kn(n),this.targetCount+=1,ie.resolve()}updateTargetData(e,n){return this.Kn(n),ie.resolve()}removeTargetData(e,n){return this.Nr.delete(n.target),this.Br.gr(n.targetId),this.targetCount-=1,ie.resolve()}removeTargets(e,n,r){let a=0;const i=[];return this.Nr.forEach((s,o)=>{o.sequenceNumber<=n&&r.get(o.targetId)===null&&(this.Nr.delete(s),i.push(this.removeMatchingKeysForTargetId(e,o.targetId)),a++)}),ie.waitFor(i).next(()=>a)}getTargetCount(e){return ie.resolve(this.targetCount)}getTargetData(e,n){const r=this.Nr.get(n)||null;return ie.resolve(r)}addMatchingKeys(e,n,r){return this.Br.Rr(n,r),ie.resolve()}removeMatchingKeys(e,n,r){this.Br.mr(n,r);const a=this.persistence.referenceDelegate,i=[];return a&&n.forEach(s=>{i.push(a.markPotentiallyOrphaned(e,s))}),ie.waitFor(i)}removeMatchingKeysForTargetId(e,n){return this.Br.gr(n),ie.resolve()}getMatchingKeysForTargetId(e,n){const r=this.Br.yr(n);return ie.resolve(r)}containsKey(e,n){return ie.resolve(this.Br.containsKey(n))}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class ej{constructor(e,n){this.qr={},this.overlays={},this.Qr=new AE(0),this.Kr=!1,this.Kr=!0,this.$r=new JV,this.referenceDelegate=e(this),this.Ur=new ZV(this),this.indexManager=new zV,this.remoteDocumentCache=function(a){return new XV(a)}(r=>this.referenceDelegate.Wr(r)),this.serializer=new VV(n),this.Gr=new $V(this.serializer)}start(){return Promise.resolve()}shutdown(){return this.Kr=!1,Promise.resolve()}get started(){return this.Kr}setDatabaseDeletedListener(){}setNetworkEnabled(){}getIndexManager(e){return this.indexManager}getDocumentOverlayCache(e){let n=this.overlays[e.toKey()];return n||(n=new KV,this.overlays[e.toKey()]=n),n}getMutationQueue(e,n){let r=this.qr[e.toKey()];return r||(r=new YV(n,this.referenceDelegate),this.qr[e.toKey()]=r),r}getGlobalsCache(){return this.$r}getTargetCache(){return this.Ur}getRemoteDocumentCache(){return this.remoteDocumentCache}getBundleCache(){return this.Gr}runTransaction(e,n,r){Ce("MemoryPersistence","Starting transaction:",e);const a=new tj(this.Qr.next());return this.referenceDelegate.zr(),r(a).next(i=>this.referenceDelegate.jr(a).next(()=>i)).toPromise().then(i=>(a.raiseOnCommittedEvent(),i))}Hr(e,n){return ie.or(Object.values(this.qr).map(r=>()=>r.containsKey(e,n)))}}class tj extends FU{constructor(e){super(),this.currentSequenceNumber=e}}class BE{constructor(e){this.persistence=e,this.Jr=new FE,this.Yr=null}static Zr(e){return new BE(e)}get Xr(){if(this.Yr)return this.Yr;throw ze()}addReference(e,n,r){return this.Jr.addReference(r,n),this.Xr.delete(r.toString()),ie.resolve()}removeReference(e,n,r){return this.Jr.removeReference(r,n),this.Xr.add(r.toString()),ie.resolve()}markPotentiallyOrphaned(e,n){return this.Xr.add(n.toString()),ie.resolve()}removeTarget(e,n){this.Jr.gr(n.targetId).forEach(a=>this.Xr.add(a.toString()));const r=this.persistence.getTargetCache();return r.getMatchingKeysForTargetId(e,n.targetId).next(a=>{a.forEach(i=>this.Xr.add(i.toString()))}).next(()=>r.removeTargetData(e,n))}zr(){this.Yr=new Set}jr(e){const n=this.persistence.getRemoteDocumentCache().newChangeBuffer();return ie.forEach(this.Xr,r=>{const a=Ne.fromPath(r);return this.ei(e,a).next(i=>{i||n.removeEntry(a,Fe.min())})}).next(()=>(this.Yr=null,n.apply(e)))}updateLimboDocument(e,n){return this.ei(e,n).next(r=>{r?this.Xr.delete(n.toString()):this.Xr.add(n.toString())})}Wr(e){return 0}ei(e,n){return ie.or([()=>ie.resolve(this.Jr.containsKey(n)),()=>this.persistence.getTargetCache().containsKey(e,n),()=>this.persistence.Hr(e,n)])}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class UE{constructor(e,n,r,a){this.targetId=e,this.fromCache=n,this.$i=r,this.Ui=a}static Wi(e,n){let r=Ze(),a=Ze();for(const i of n.docChanges)switch(i.type){case 0:r=r.add(i.doc.key);break;case 1:a=a.add(i.doc.key)}return new UE(e,n.fromCache,r,a)}}/** * @license * Copyright 2023 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class nj{constructor(){this._documentReadCount=0}get documentReadCount(){return this._documentReadCount}incrementDocumentReadCount(e){this._documentReadCount+=e}}/** * @license * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class rj{constructor(){this.Gi=!1,this.zi=!1,this.ji=100,this.Hi=function(){return kF()?8:BU(zn())>0?6:4}()}initialize(e,n){this.Ji=e,this.indexManager=n,this.Gi=!0}getDocumentsMatchingQuery(e,n,r,a){const i={result:null};return this.Yi(e,n).next(s=>{i.result=s}).next(()=>{if(!i.result)return this.Zi(e,n,a,r).next(s=>{i.result=s})}).next(()=>{if(i.result)return;const s=new nj;return this.Xi(e,n,s).next(o=>{if(i.result=o,this.zi)return this.es(e,n,s,o.size)})}).next(()=>i.result)}es(e,n,r,a){return r.documentReadCountthis.Hi*a?(ic()<=Ke.DEBUG&&Ce("QueryEngine","The SDK decides to create cache indexes for query:",nl(n),"as using cache indexes may help improve performance."),this.indexManager.createTargetIndexes(e,Pa(n))):ie.resolve())}Yi(e,n){if(nw(n))return ie.resolve(null);let r=Pa(n);return this.indexManager.getIndexType(e,r).next(a=>a===0?null:(n.limit!==null&&a===1&&(n=G1(n,null,"F"),r=Pa(n)),this.indexManager.getDocumentsMatchingTarget(e,r).next(i=>{const s=Ze(...i);return this.Ji.getDocuments(e,s).next(o=>this.indexManager.getMinOffset(e,r).next(l=>{const u=this.ts(n,o);return this.ns(n,u,s,l.readTime)?this.Yi(e,G1(n,null,"F")):this.rs(e,u,n,l)}))})))}Zi(e,n,r,a){return nw(n)||a.isEqual(Fe.min())?ie.resolve(null):this.Ji.getDocuments(e,r).next(i=>{const s=this.ts(n,i);return this.ns(n,s,r,a)?ie.resolve(null):(ic()<=Ke.DEBUG&&Ce("QueryEngine","Re-using previous result from %s to execute query: %s",a.toString(),nl(n)),this.rs(e,s,n,OU(a,-1)).next(o=>o))})}ts(e,n){let r=new wn(S4(e));return n.forEach((a,i)=>{pm(e,i)&&(r=r.add(i))}),r}ns(e,n,r,a){if(e.limit===null)return!1;if(r.size!==n.size)return!0;const i=e.limitType==="F"?n.last():n.first();return!!i&&(i.hasPendingWrites||i.version.compareTo(a)>0)}Xi(e,n,r){return ic()<=Ke.DEBUG&&Ce("QueryEngine","Using full collection scan to execute query:",nl(n)),this.Ji.getDocumentsMatchingQuery(e,n,gs.min(),r)}rs(e,n,r,a){return this.Ji.getDocumentsMatchingQuery(e,r,a).next(i=>(n.forEach(s=>{i=i.insert(s.key,s)}),i))}}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class aj{constructor(e,n,r,a){this.persistence=e,this.ss=n,this.serializer=a,this.os=new jt(it),this._s=new Su(i=>kE(i),NE),this.us=new Map,this.cs=e.getRemoteDocumentCache(),this.Ur=e.getTargetCache(),this.Gr=e.getBundleCache(),this.ls(r)}ls(e){this.documentOverlayCache=this.persistence.getDocumentOverlayCache(e),this.indexManager=this.persistence.getIndexManager(e),this.mutationQueue=this.persistence.getMutationQueue(e,this.indexManager),this.localDocuments=new WV(this.cs,this.mutationQueue,this.documentOverlayCache,this.indexManager),this.cs.setIndexManager(this.indexManager),this.ss.initialize(this.localDocuments,this.indexManager)}collectGarbage(e){return this.persistence.runTransaction("Collect garbage","readwrite-primary",n=>e.collect(n,this.os))}}function ij(t,e,n,r){return new aj(t,e,n,r)}async function V4(t,e){const n=Qe(t);return await n.persistence.runTransaction("Handle user change","readonly",r=>{let a;return n.mutationQueue.getAllMutationBatches(r).next(i=>(a=i,n.ls(e),n.mutationQueue.getAllMutationBatches(r))).next(i=>{const s=[],o=[];let l=Ze();for(const u of a){s.push(u.batchId);for(const c of u.mutations)l=l.add(c.key)}for(const u of i){o.push(u.batchId);for(const c of u.mutations)l=l.add(c.key)}return n.localDocuments.getDocuments(r,l).next(u=>({hs:u,removedBatchIds:s,addedBatchIds:o}))})})}function j4(t){const e=Qe(t);return e.persistence.runTransaction("Get last remote snapshot version","readonly",n=>e.Ur.getLastRemoteSnapshotVersion(n))}function sj(t,e){const n=Qe(t),r=e.snapshotVersion;let a=n.os;return n.persistence.runTransaction("Apply remote event","readwrite-primary",i=>{const s=n.cs.newChangeBuffer({trackRemovals:!0});a=n.os;const o=[];e.targetChanges.forEach((c,h)=>{const f=a.get(h);if(!f)return;o.push(n.Ur.removeMatchingKeys(i,c.removedDocuments,h).next(()=>n.Ur.addMatchingKeys(i,c.addedDocuments,h)));let p=f.withSequenceNumber(i.currentSequenceNumber);e.targetMismatches.get(h)!==null?p=p.withResumeToken(In.EMPTY_BYTE_STRING,Fe.min()).withLastLimboFreeSnapshotVersion(Fe.min()):c.resumeToken.approximateByteSize()>0&&(p=p.withResumeToken(c.resumeToken,r)),a=a.insert(h,p),function(m,_,x){return m.resumeToken.approximateByteSize()===0||_.snapshotVersion.toMicroseconds()-m.snapshotVersion.toMicroseconds()>=3e8?!0:x.addedDocuments.size+x.modifiedDocuments.size+x.removedDocuments.size>0}(f,p,c)&&o.push(n.Ur.updateTargetData(i,p))});let l=_s(),u=Ze();if(e.documentUpdates.forEach(c=>{e.resolvedLimboDocuments.has(c)&&o.push(n.persistence.referenceDelegate.updateLimboDocument(i,c))}),o.push(oj(i,s,e.documentUpdates).next(c=>{l=c.Ps,u=c.Is})),!r.isEqual(Fe.min())){const c=n.Ur.getLastRemoteSnapshotVersion(i).next(h=>n.Ur.setTargetsMetadata(i,i.currentSequenceNumber,r));o.push(c)}return ie.waitFor(o).next(()=>s.apply(i)).next(()=>n.localDocuments.getLocalViewOfDocuments(i,l,u)).next(()=>l)}).then(i=>(n.os=a,i))}function oj(t,e,n){let r=Ze(),a=Ze();return n.forEach(i=>r=r.add(i)),e.getEntries(t,r).next(i=>{let s=_s();return n.forEach((o,l)=>{const u=i.get(o);l.isFoundDocument()!==u.isFoundDocument()&&(a=a.add(o)),l.isNoDocument()&&l.version.isEqual(Fe.min())?(e.removeEntry(o,l.readTime),s=s.insert(o,l)):!u.isValidDocument()||l.version.compareTo(u.version)>0||l.version.compareTo(u.version)===0&&u.hasPendingWrites?(e.addEntry(l),s=s.insert(o,l)):Ce("LocalStore","Ignoring outdated watch update for ",o,". Current version:",u.version," Watch version:",l.version)}),{Ps:s,Is:a}})}function lj(t,e){const n=Qe(t);return n.persistence.runTransaction("Allocate target","readwrite",r=>{let a;return n.Ur.getTargetData(r,e).next(i=>i?(a=i,ie.resolve(a)):n.Ur.allocateTargetId(r).next(s=>(a=new Gi(e,s,"TargetPurposeListen",r.currentSequenceNumber),n.Ur.addTargetData(r,a).next(()=>a))))}).then(r=>{const a=n.os.get(r.targetId);return(a===null||r.snapshotVersion.compareTo(a.snapshotVersion)>0)&&(n.os=n.os.insert(r.targetId,r),n._s.set(e,r.targetId)),r})}async function J1(t,e,n){const r=Qe(t),a=r.os.get(e),i=n?"readwrite":"readwrite-primary";try{n||await r.persistence.runTransaction("Release target",i,s=>r.persistence.referenceDelegate.removeTarget(s,a))}catch(s){if(!dh(s))throw s;Ce("LocalStore",`Failed to update sequence numbers for target ${e}: ${s}`)}r.os=r.os.remove(e),r._s.delete(a.target)}function fw(t,e,n){const r=Qe(t);let a=Fe.min(),i=Ze();return r.persistence.runTransaction("Execute query","readwrite",s=>function(l,u,c){const h=Qe(l),f=h._s.get(c);return f!==void 0?ie.resolve(h.os.get(f)):h.Ur.getTargetData(u,c)}(r,s,Pa(e)).next(o=>{if(o)return a=o.lastLimboFreeSnapshotVersion,r.Ur.getMatchingKeysForTargetId(s,o.targetId).next(l=>{i=l})}).next(()=>r.ss.getDocumentsMatchingQuery(s,e,n?a:Fe.min(),n?i:Ze())).next(o=>(uj(r,rV(e),o),{documents:o,Ts:i})))}function uj(t,e,n){let r=t.us.get(e)||Fe.min();n.forEach((a,i)=>{i.readTime.compareTo(r)>0&&(r=i.readTime)}),t.us.set(e,r)}class pw{constructor(){this.activeTargetIds=uV()}fs(e){this.activeTargetIds=this.activeTargetIds.add(e)}gs(e){this.activeTargetIds=this.activeTargetIds.delete(e)}Vs(){const e={activeTargetIds:this.activeTargetIds.toArray(),updateTimeMs:Date.now()};return JSON.stringify(e)}}class cj{constructor(){this.so=new pw,this.oo={},this.onlineStateHandler=null,this.sequenceNumberHandler=null}addPendingMutation(e){}updateMutationState(e,n,r){}addLocalQueryTarget(e){return this.so.fs(e),this.oo[e]||"not-current"}updateQueryState(e,n,r){this.oo[e]=n}removeLocalQueryTarget(e){this.so.gs(e)}isLocalQueryTarget(e){return this.so.activeTargetIds.has(e)}clearQueryState(e){delete this.oo[e]}getAllActiveQueryTargets(){return this.so.activeTargetIds}isActiveQueryTarget(e){return this.so.activeTargetIds.has(e)}start(){return this.so=new pw,Promise.resolve()}handleUserChange(e,n,r){}setOnlineState(e){}shutdown(){}writeSequenceNumber(e){}notifyBundleLoaded(e){}}/** * @license * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class dj{_o(e){}shutdown(){}}/** * @license * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class mw{constructor(){this.ao=()=>this.uo(),this.co=()=>this.lo(),this.ho=[],this.Po()}_o(e){this.ho.push(e)}shutdown(){window.removeEventListener("online",this.ao),window.removeEventListener("offline",this.co)}Po(){window.addEventListener("online",this.ao),window.addEventListener("offline",this.co)}uo(){Ce("ConnectivityMonitor","Network connectivity changed: AVAILABLE");for(const e of this.ho)e(0)}lo(){Ce("ConnectivityMonitor","Network connectivity changed: UNAVAILABLE");for(const e of this.ho)e(1)}static D(){return typeof window<"u"&&window.addEventListener!==void 0&&window.removeEventListener!==void 0}}/** * @license * Copyright 2023 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */let ff=null;function Gg(){return ff===null?ff=function(){return 268435456+Math.round(2147483648*Math.random())}():ff++,"0x"+ff.toString(16)}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const hj={BatchGetDocuments:"batchGet",Commit:"commit",RunQuery:"runQuery",RunAggregationQuery:"runAggregationQuery"};/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class fj{constructor(e){this.Io=e.Io,this.To=e.To}Eo(e){this.Ao=e}Ro(e){this.Vo=e}mo(e){this.fo=e}onMessage(e){this.po=e}close(){this.To()}send(e){this.Io(e)}yo(){this.Ao()}wo(){this.Vo()}So(e){this.fo(e)}bo(e){this.po(e)}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const Mn="WebChannelConnection";class pj extends class{constructor(n){this.databaseInfo=n,this.databaseId=n.databaseId;const r=n.ssl?"https":"http",a=encodeURIComponent(this.databaseId.projectId),i=encodeURIComponent(this.databaseId.database);this.Do=r+"://"+n.host,this.vo=`projects/${a}/databases/${i}`,this.Co=this.databaseId.database==="(default)"?`project_id=${a}`:`project_id=${a}&database_id=${i}`}get Fo(){return!1}Mo(n,r,a,i,s){const o=Gg(),l=this.xo(n,r.toUriEncodedString());Ce("RestConnection",`Sending RPC '${n}' ${o}:`,l,a);const u={"google-cloud-resource-prefix":this.vo,"x-goog-request-params":this.Co};return this.Oo(u,i,s),this.No(n,l,u,a).then(c=>(Ce("RestConnection",`Received RPC '${n}' ${o}: `,c),c),c=>{throw eu("RestConnection",`RPC '${n}' ${o} failed with error: `,c,"url: ",l,"request:",a),c})}Lo(n,r,a,i,s,o){return this.Mo(n,r,a,i,s)}Oo(n,r,a){n["X-Goog-Api-Client"]=function(){return"gl-js/ fire/"+xu}(),n["Content-Type"]="text/plain",this.databaseInfo.appId&&(n["X-Firebase-GMPID"]=this.databaseInfo.appId),r&&r.headers.forEach((i,s)=>n[s]=i),a&&a.headers.forEach((i,s)=>n[s]=i)}xo(n,r){const a=hj[n];return`${this.Do}/v1/${r}:${a}`}terminate(){}}{constructor(e){super(e),this.forceLongPolling=e.forceLongPolling,this.autoDetectLongPolling=e.autoDetectLongPolling,this.useFetchStreams=e.useFetchStreams,this.longPollingOptions=e.longPollingOptions}No(e,n,r,a){const i=Gg();return new Promise((s,o)=>{const l=new o4;l.setWithCredentials(!0),l.listenOnce(u4.COMPLETE,()=>{try{switch(l.getLastErrorCode()){case Wf.NO_ERROR:const c=l.getResponseJson();Ce(Mn,`XHR for RPC '${e}' ${i} received:`,JSON.stringify(c)),s(c);break;case Wf.TIMEOUT:Ce(Mn,`RPC '${e}' ${i} timed out`),o(new ke(ve.DEADLINE_EXCEEDED,"Request time out"));break;case Wf.HTTP_ERROR:const h=l.getStatus();if(Ce(Mn,`RPC '${e}' ${i} failed with status:`,h,"response text:",l.getResponseText()),h>0){let f=l.getResponseJson();Array.isArray(f)&&(f=f[0]);const p=f==null?void 0:f.error;if(p&&p.status&&p.message){const g=function(_){const x=_.toLowerCase().replace(/_/g,"-");return Object.values(ve).indexOf(x)>=0?x:ve.UNKNOWN}(p.status);o(new ke(g,p.message))}else o(new ke(ve.UNKNOWN,"Server responded with status "+l.getStatus()))}else o(new ke(ve.UNAVAILABLE,"Connection failed."));break;default:ze()}}finally{Ce(Mn,`RPC '${e}' ${i} completed.`)}});const u=JSON.stringify(a);Ce(Mn,`RPC '${e}' ${i} sending request:`,a),l.send(n,"POST",u,r,15)})}Bo(e,n,r){const a=Gg(),i=[this.Do,"/","google.firestore.v1.Firestore","/",e,"/channel"],s=h4(),o=d4(),l={httpSessionIdParam:"gsessionid",initMessageHeaders:{},messageUrlParams:{database:`projects/${this.databaseId.projectId}/databases/${this.databaseId.database}`},sendRawJson:!0,supportsCrossDomainXhr:!0,internalChannelParams:{forwardChannelRequestTimeoutMs:6e5},forceLongPolling:this.forceLongPolling,detectBufferingProxy:this.autoDetectLongPolling},u=this.longPollingOptions.timeoutSeconds;u!==void 0&&(l.longPollingTimeout=Math.round(1e3*u)),this.useFetchStreams&&(l.xmlHttpFactory=new l4({})),this.Oo(l.initMessageHeaders,n,r),l.encodeInitMessageHeaders=!0;const c=i.join("");Ce(Mn,`Creating RPC '${e}' stream ${a}: ${c}`,l);const h=s.createWebChannel(c,l);let f=!1,p=!1;const g=new fj({Io:_=>{p?Ce(Mn,`Not sending because RPC '${e}' stream ${a} is closed:`,_):(f||(Ce(Mn,`Opening RPC '${e}' stream ${a} transport.`),h.open(),f=!0),Ce(Mn,`RPC '${e}' stream ${a} sending:`,_),h.send(_))},To:()=>h.close()}),m=(_,x,E)=>{_.listen(x,y=>{try{E(y)}catch(I){setTimeout(()=>{throw I},0)}})};return m(h,mc.EventType.OPEN,()=>{p||(Ce(Mn,`RPC '${e}' stream ${a} transport opened.`),g.yo())}),m(h,mc.EventType.CLOSE,()=>{p||(p=!0,Ce(Mn,`RPC '${e}' stream ${a} transport closed`),g.So())}),m(h,mc.EventType.ERROR,_=>{p||(p=!0,eu(Mn,`RPC '${e}' stream ${a} transport errored:`,_),g.So(new ke(ve.UNAVAILABLE,"The operation could not be completed")))}),m(h,mc.EventType.MESSAGE,_=>{var x;if(!p){const E=_.data[0];$t(!!E);const y=E,I=y.error||((x=y[0])===null||x===void 0?void 0:x.error);if(I){Ce(Mn,`RPC '${e}' stream ${a} received error:`,I);const j=I.status;let G=function(w){const A=Gt[w];if(A!==void 0)return k4(A)}(j),T=I.message;G===void 0&&(G=ve.INTERNAL,T="Unknown error status: "+j+" with message "+I.message),p=!0,g.So(new ke(G,T)),h.close()}else Ce(Mn,`RPC '${e}' stream ${a} received:`,E),g.bo(E)}}),m(o,c4.STAT_EVENT,_=>{_.stat===B1.PROXY?Ce(Mn,`RPC '${e}' stream ${a} detected buffering proxy`):_.stat===B1.NOPROXY&&Ce(Mn,`RPC '${e}' stream ${a} detected no buffering proxy`)}),setTimeout(()=>{g.wo()},0),g}}function Hg(){return typeof document<"u"?document:null}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function z4(t){return new AV(t,!0)}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class q4{constructor(e,n,r=1e3,a=1.5,i=6e4){this.ui=e,this.timerId=n,this.ko=r,this.qo=a,this.Qo=i,this.Ko=0,this.$o=null,this.Uo=Date.now(),this.reset()}reset(){this.Ko=0}Wo(){this.Ko=this.Qo}Go(e){this.cancel();const n=Math.floor(this.Ko+this.zo()),r=Math.max(0,Date.now()-this.Uo),a=Math.max(0,n-r);a>0&&Ce("ExponentialBackoff",`Backing off for ${a} ms (base delay: ${this.Ko} ms, delay with jitter: ${n} ms, last attempt: ${r} ms ago)`),this.$o=this.ui.enqueueAfterDelay(this.timerId,a,()=>(this.Uo=Date.now(),e())),this.Ko*=this.qo,this.Kothis.Qo&&(this.Ko=this.Qo)}jo(){this.$o!==null&&(this.$o.skipDelay(),this.$o=null)}cancel(){this.$o!==null&&(this.$o.cancel(),this.$o=null)}zo(){return(Math.random()-.5)*this.Ko}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class mj{constructor(e,n,r,a,i,s,o,l){this.ui=e,this.Ho=r,this.Jo=a,this.connection=i,this.authCredentialsProvider=s,this.appCheckCredentialsProvider=o,this.listener=l,this.state=0,this.Yo=0,this.Zo=null,this.Xo=null,this.stream=null,this.e_=0,this.t_=new q4(e,n)}n_(){return this.state===1||this.state===5||this.r_()}r_(){return this.state===2||this.state===3}start(){this.e_=0,this.state!==4?this.auth():this.i_()}async stop(){this.n_()&&await this.close(0)}s_(){this.state=0,this.t_.reset()}o_(){this.r_()&&this.Zo===null&&(this.Zo=this.ui.enqueueAfterDelay(this.Ho,6e4,()=>this.__()))}a_(e){this.u_(),this.stream.send(e)}async __(){if(this.r_())return this.close(0)}u_(){this.Zo&&(this.Zo.cancel(),this.Zo=null)}c_(){this.Xo&&(this.Xo.cancel(),this.Xo=null)}async close(e,n){this.u_(),this.c_(),this.t_.cancel(),this.Yo++,e!==4?this.t_.reset():n&&n.code===ve.RESOURCE_EXHAUSTED?(di(n.toString()),di("Using maximum backoff delay to prevent overloading the backend."),this.t_.Wo()):n&&n.code===ve.UNAUTHENTICATED&&this.state!==3&&(this.authCredentialsProvider.invalidateToken(),this.appCheckCredentialsProvider.invalidateToken()),this.stream!==null&&(this.l_(),this.stream.close(),this.stream=null),this.state=e,await this.listener.mo(n)}l_(){}auth(){this.state=1;const e=this.h_(this.Yo),n=this.Yo;Promise.all([this.authCredentialsProvider.getToken(),this.appCheckCredentialsProvider.getToken()]).then(([r,a])=>{this.Yo===n&&this.P_(r,a)},r=>{e(()=>{const a=new ke(ve.UNKNOWN,"Fetching auth token failed: "+r.message);return this.I_(a)})})}P_(e,n){const r=this.h_(this.Yo);this.stream=this.T_(e,n),this.stream.Eo(()=>{r(()=>this.listener.Eo())}),this.stream.Ro(()=>{r(()=>(this.state=2,this.Xo=this.ui.enqueueAfterDelay(this.Jo,1e4,()=>(this.r_()&&(this.state=3),Promise.resolve())),this.listener.Ro()))}),this.stream.mo(a=>{r(()=>this.I_(a))}),this.stream.onMessage(a=>{r(()=>++this.e_==1?this.E_(a):this.onNext(a))})}i_(){this.state=5,this.t_.Go(async()=>{this.state=0,this.start()})}I_(e){return Ce("PersistentStream",`close with error: ${e}`),this.stream=null,this.close(4,e)}h_(e){return n=>{this.ui.enqueueAndForget(()=>this.Yo===e?n():(Ce("PersistentStream","stream callback skipped by getCloseGuardedDispatcher."),Promise.resolve()))}}}class gj extends mj{constructor(e,n,r,a,i,s){super(e,"listen_stream_connection_backoff","listen_stream_idle","health_check_timeout",n,r,a,s),this.serializer=i}T_(e,n){return this.connection.Bo("Listen",e,n)}E_(e){return this.onNext(e)}onNext(e){this.t_.reset();const n=NV(this.serializer,e),r=function(i){if(!("targetChange"in i))return Fe.min();const s=i.targetChange;return s.targetIds&&s.targetIds.length?Fe.min():s.readTime?Ml(s.readTime):Fe.min()}(e);return this.listener.d_(n,r)}A_(e){const n={};n.database=hw(this.serializer),n.addTarget=function(i,s){let o;const l=s.target;if(o=q1(l)?{documents:OV(i,l)}:{query:MV(i,l)._t},o.targetId=s.targetId,s.resumeToken.approximateByteSize()>0){o.resumeToken=PV(i,s.resumeToken);const u=$1(i,s.expectedCount);u!==null&&(o.expectedCount=u)}else if(s.snapshotVersion.compareTo(Fe.min())>0){o.readTime=IV(i,s.snapshotVersion.toTimestamp());const u=$1(i,s.expectedCount);u!==null&&(o.expectedCount=u)}return o}(this.serializer,e);const r=DV(this.serializer,e);r&&(n.labels=r),this.a_(n)}R_(e){const n={};n.database=hw(this.serializer),n.removeTarget=e,this.a_(n)}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class vj extends class{}{constructor(e,n,r,a){super(),this.authCredentials=e,this.appCheckCredentials=n,this.connection=r,this.serializer=a,this.y_=!1}w_(){if(this.y_)throw new ke(ve.FAILED_PRECONDITION,"The client has already been terminated.")}Mo(e,n,r,a){return this.w_(),Promise.all([this.authCredentials.getToken(),this.appCheckCredentials.getToken()]).then(([i,s])=>this.connection.Mo(e,K1(n,r),a,i,s)).catch(i=>{throw i.name==="FirebaseError"?(i.code===ve.UNAUTHENTICATED&&(this.authCredentials.invalidateToken(),this.appCheckCredentials.invalidateToken()),i):new ke(ve.UNKNOWN,i.toString())})}Lo(e,n,r,a,i){return this.w_(),Promise.all([this.authCredentials.getToken(),this.appCheckCredentials.getToken()]).then(([s,o])=>this.connection.Lo(e,K1(n,r),a,s,o,i)).catch(s=>{throw s.name==="FirebaseError"?(s.code===ve.UNAUTHENTICATED&&(this.authCredentials.invalidateToken(),this.appCheckCredentials.invalidateToken()),s):new ke(ve.UNKNOWN,s.toString())})}terminate(){this.y_=!0,this.connection.terminate()}}class _j{constructor(e,n){this.asyncQueue=e,this.onlineStateHandler=n,this.state="Unknown",this.S_=0,this.b_=null,this.D_=!0}v_(){this.S_===0&&(this.C_("Unknown"),this.b_=this.asyncQueue.enqueueAfterDelay("online_state_timeout",1e4,()=>(this.b_=null,this.F_("Backend didn't respond within 10 seconds."),this.C_("Offline"),Promise.resolve())))}M_(e){this.state==="Online"?this.C_("Unknown"):(this.S_++,this.S_>=1&&(this.x_(),this.F_(`Connection failed 1 times. Most recent error: ${e.toString()}`),this.C_("Offline")))}set(e){this.x_(),this.S_=0,e==="Online"&&(this.D_=!1),this.C_(e)}C_(e){e!==this.state&&(this.state=e,this.onlineStateHandler(e))}F_(e){const n=`Could not reach Cloud Firestore backend. ${e} This typically indicates that your device does not have a healthy Internet connection at the moment. The client will operate in offline mode until it is able to successfully connect to the backend.`;this.D_?(di(n),this.D_=!1):Ce("OnlineStateTracker",n)}x_(){this.b_!==null&&(this.b_.cancel(),this.b_=null)}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class yj{constructor(e,n,r,a,i){this.localStore=e,this.datastore=n,this.asyncQueue=r,this.remoteSyncer={},this.O_=[],this.N_=new Map,this.L_=new Set,this.B_=[],this.k_=i,this.k_._o(s=>{r.enqueueAndForget(async()=>{ph(this)&&(Ce("RemoteStore","Restarting streams for network reachability change."),await async function(l){const u=Qe(l);u.L_.add(4),await fh(u),u.q_.set("Unknown"),u.L_.delete(4),await _m(u)}(this))})}),this.q_=new _j(r,a)}}async function _m(t){if(ph(t))for(const e of t.B_)await e(!0)}async function fh(t){for(const e of t.B_)await e(!1)}function G4(t,e){const n=Qe(t);n.N_.has(e.targetId)||(n.N_.set(e.targetId,e),qE(n)?zE(n):Tu(n).r_()&&jE(n,e))}function VE(t,e){const n=Qe(t),r=Tu(n);n.N_.delete(e),r.r_()&&H4(n,e),n.N_.size===0&&(r.r_()?r.o_():ph(n)&&n.q_.set("Unknown"))}function jE(t,e){if(t.Q_.xe(e.targetId),e.resumeToken.approximateByteSize()>0||e.snapshotVersion.compareTo(Fe.min())>0){const n=t.remoteSyncer.getRemoteKeysForTarget(e.targetId).size;e=e.withExpectedCount(n)}Tu(t).A_(e)}function H4(t,e){t.Q_.xe(e),Tu(t).R_(e)}function zE(t){t.Q_=new SV({getRemoteKeysForTarget:e=>t.remoteSyncer.getRemoteKeysForTarget(e),ot:e=>t.N_.get(e)||null,tt:()=>t.datastore.serializer.databaseId}),Tu(t).start(),t.q_.v_()}function qE(t){return ph(t)&&!Tu(t).n_()&&t.N_.size>0}function ph(t){return Qe(t).L_.size===0}function W4(t){t.Q_=void 0}async function Ej(t){t.q_.set("Online")}async function bj(t){t.N_.forEach((e,n)=>{jE(t,e)})}async function xj(t,e){W4(t),qE(t)?(t.q_.M_(e),zE(t)):t.q_.set("Unknown")}async function Sj(t,e,n){if(t.q_.set("Online"),e instanceof O4&&e.state===2&&e.cause)try{await async function(a,i){const s=i.cause;for(const o of i.targetIds)a.N_.has(o)&&(await a.remoteSyncer.rejectListen(o,s),a.N_.delete(o),a.Q_.removeTarget(o))}(t,e)}catch(r){Ce("RemoteStore","Failed to remove targets %s: %s ",e.targetIds.join(","),r),await gw(t,r)}else if(e instanceof Kf?t.Q_.Ke(e):e instanceof N4?t.Q_.He(e):t.Q_.We(e),!n.isEqual(Fe.min()))try{const r=await j4(t.localStore);n.compareTo(r)>=0&&await function(i,s){const o=i.Q_.rt(s);return o.targetChanges.forEach((l,u)=>{if(l.resumeToken.approximateByteSize()>0){const c=i.N_.get(u);c&&i.N_.set(u,c.withResumeToken(l.resumeToken,s))}}),o.targetMismatches.forEach((l,u)=>{const c=i.N_.get(l);if(!c)return;i.N_.set(l,c.withResumeToken(In.EMPTY_BYTE_STRING,c.snapshotVersion)),H4(i,l);const h=new Gi(c.target,l,u,c.sequenceNumber);jE(i,h)}),i.remoteSyncer.applyRemoteEvent(o)}(t,n)}catch(r){Ce("RemoteStore","Failed to raise snapshot:",r),await gw(t,r)}}async function gw(t,e,n){if(!dh(e))throw e;t.L_.add(1),await fh(t),t.q_.set("Offline"),n||(n=()=>j4(t.localStore)),t.asyncQueue.enqueueRetryable(async()=>{Ce("RemoteStore","Retrying IndexedDB access"),await n(),t.L_.delete(1),await _m(t)})}async function vw(t,e){const n=Qe(t);n.asyncQueue.verifyOperationInProgress(),Ce("RemoteStore","RemoteStore received new credentials");const r=ph(n);n.L_.add(3),await fh(n),r&&n.q_.set("Unknown"),await n.remoteSyncer.handleCredentialChange(e),n.L_.delete(3),await _m(n)}async function Tj(t,e){const n=Qe(t);e?(n.L_.delete(2),await _m(n)):e||(n.L_.add(2),await fh(n),n.q_.set("Unknown"))}function Tu(t){return t.K_||(t.K_=function(n,r,a){const i=Qe(n);return i.w_(),new gj(r,i.connection,i.authCredentials,i.appCheckCredentials,i.serializer,a)}(t.datastore,t.asyncQueue,{Eo:Ej.bind(null,t),Ro:bj.bind(null,t),mo:xj.bind(null,t),d_:Sj.bind(null,t)}),t.B_.push(async e=>{e?(t.K_.s_(),qE(t)?zE(t):t.q_.set("Unknown")):(await t.K_.stop(),W4(t))})),t.K_}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class GE{constructor(e,n,r,a,i){this.asyncQueue=e,this.timerId=n,this.targetTimeMs=r,this.op=a,this.removalCallback=i,this.deferred=new ao,this.then=this.deferred.promise.then.bind(this.deferred.promise),this.deferred.promise.catch(s=>{})}get promise(){return this.deferred.promise}static createAndSchedule(e,n,r,a,i){const s=Date.now()+r,o=new GE(e,n,s,a,i);return o.start(r),o}start(e){this.timerHandle=setTimeout(()=>this.handleDelayElapsed(),e)}skipDelay(){return this.handleDelayElapsed()}cancel(e){this.timerHandle!==null&&(this.clearTimeout(),this.deferred.reject(new ke(ve.CANCELLED,"Operation cancelled"+(e?": "+e:""))))}handleDelayElapsed(){this.asyncQueue.enqueueAndForget(()=>this.timerHandle!==null?(this.clearTimeout(),this.op().then(e=>this.deferred.resolve(e))):Promise.resolve())}clearTimeout(){this.timerHandle!==null&&(this.removalCallback(this),clearTimeout(this.timerHandle),this.timerHandle=null)}}function $4(t,e){if(di("AsyncQueue",`${e}: ${t}`),dh(t))return new ke(ve.UNAVAILABLE,`${e}: ${t}`);throw t}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class Ll{constructor(e){this.comparator=e?(n,r)=>e(n,r)||Ne.comparator(n.key,r.key):(n,r)=>Ne.comparator(n.key,r.key),this.keyedMap=gc(),this.sortedSet=new jt(this.comparator)}static emptySet(e){return new Ll(e.comparator)}has(e){return this.keyedMap.get(e)!=null}get(e){return this.keyedMap.get(e)}first(){return this.sortedSet.minKey()}last(){return this.sortedSet.maxKey()}isEmpty(){return this.sortedSet.isEmpty()}indexOf(e){const n=this.keyedMap.get(e);return n?this.sortedSet.indexOf(n):-1}get size(){return this.sortedSet.size}forEach(e){this.sortedSet.inorderTraversal((n,r)=>(e(n),!1))}add(e){const n=this.delete(e.key);return n.copy(n.keyedMap.insert(e.key,e),n.sortedSet.insert(e,null))}delete(e){const n=this.get(e);return n?this.copy(this.keyedMap.remove(e),this.sortedSet.remove(n)):this}isEqual(e){if(!(e instanceof Ll)||this.size!==e.size)return!1;const n=this.sortedSet.getIterator(),r=e.sortedSet.getIterator();for(;n.hasNext();){const a=n.getNext().key,i=r.getNext().key;if(!a.isEqual(i))return!1}return!0}toString(){const e=[];return this.forEach(n=>{e.push(n.toString())}),e.length===0?"DocumentSet ()":`DocumentSet ( `+e.join(` `)+` )`}copy(e,n){const r=new Ll;return r.comparator=this.comparator,r.keyedMap=e,r.sortedSet=n,r}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class _w{constructor(){this.W_=new jt(Ne.comparator)}track(e){const n=e.doc.key,r=this.W_.get(n);r?e.type!==0&&r.type===3?this.W_=this.W_.insert(n,e):e.type===3&&r.type!==1?this.W_=this.W_.insert(n,{type:r.type,doc:e.doc}):e.type===2&&r.type===2?this.W_=this.W_.insert(n,{type:2,doc:e.doc}):e.type===2&&r.type===0?this.W_=this.W_.insert(n,{type:0,doc:e.doc}):e.type===1&&r.type===0?this.W_=this.W_.remove(n):e.type===1&&r.type===2?this.W_=this.W_.insert(n,{type:1,doc:r.doc}):e.type===0&&r.type===1?this.W_=this.W_.insert(n,{type:2,doc:e.doc}):ze():this.W_=this.W_.insert(n,e)}G_(){const e=[];return this.W_.inorderTraversal((n,r)=>{e.push(r)}),e}}class iu{constructor(e,n,r,a,i,s,o,l,u){this.query=e,this.docs=n,this.oldDocs=r,this.docChanges=a,this.mutatedKeys=i,this.fromCache=s,this.syncStateChanged=o,this.excludesMetadataChanges=l,this.hasCachedResults=u}static fromInitialDocuments(e,n,r,a,i){const s=[];return n.forEach(o=>{s.push({type:0,doc:o})}),new iu(e,n,Ll.emptySet(n),s,r,a,!0,!1,i)}get hasPendingWrites(){return!this.mutatedKeys.isEmpty()}isEqual(e){if(!(this.fromCache===e.fromCache&&this.hasCachedResults===e.hasCachedResults&&this.syncStateChanged===e.syncStateChanged&&this.mutatedKeys.isEqual(e.mutatedKeys)&&fm(this.query,e.query)&&this.docs.isEqual(e.docs)&&this.oldDocs.isEqual(e.oldDocs)))return!1;const n=this.docChanges,r=e.docChanges;if(n.length!==r.length)return!1;for(let a=0;ae.J_())}}class Cj{constructor(){this.queries=yw(),this.onlineState="Unknown",this.Y_=new Set}terminate(){(function(n,r){const a=Qe(n),i=a.queries;a.queries=yw(),i.forEach((s,o)=>{for(const l of o.j_)l.onError(r)})})(this,new ke(ve.ABORTED,"Firestore shutting down"))}}function yw(){return new Su(t=>x4(t),fm)}async function Aj(t,e){const n=Qe(t);let r=3;const a=e.query;let i=n.queries.get(a);i?!i.H_()&&e.J_()&&(r=2):(i=new wj,r=e.J_()?0:1);try{switch(r){case 0:i.z_=await n.onListen(a,!0);break;case 1:i.z_=await n.onListen(a,!1);break;case 2:await n.onFirstRemoteStoreListen(a)}}catch(s){const o=$4(s,`Initialization of query '${nl(e.query)}' failed`);return void e.onError(o)}n.queries.set(a,i),i.j_.push(e),e.Z_(n.onlineState),i.z_&&e.X_(i.z_)&&HE(n)}async function Ij(t,e){const n=Qe(t),r=e.query;let a=3;const i=n.queries.get(r);if(i){const s=i.j_.indexOf(e);s>=0&&(i.j_.splice(s,1),i.j_.length===0?a=e.J_()?0:1:!i.H_()&&e.J_()&&(a=2))}switch(a){case 0:return n.queries.delete(r),n.onUnlisten(r,!0);case 1:return n.queries.delete(r),n.onUnlisten(r,!1);case 2:return n.onLastRemoteStoreUnlisten(r);default:return}}function Pj(t,e){const n=Qe(t);let r=!1;for(const a of e){const i=a.query,s=n.queries.get(i);if(s){for(const o of s.j_)o.X_(a)&&(r=!0);s.z_=a}}r&&HE(n)}function Rj(t,e,n){const r=Qe(t),a=r.queries.get(e);if(a)for(const i of a.j_)i.onError(n);r.queries.delete(e)}function HE(t){t.Y_.forEach(e=>{e.next()})}var Y1,Ew;(Ew=Y1||(Y1={})).ea="default",Ew.Cache="cache";class kj{constructor(e,n,r){this.query=e,this.ta=n,this.na=!1,this.ra=null,this.onlineState="Unknown",this.options=r||{}}X_(e){if(!this.options.includeMetadataChanges){const r=[];for(const a of e.docChanges)a.type!==3&&r.push(a);e=new iu(e.query,e.docs,e.oldDocs,r,e.mutatedKeys,e.fromCache,e.syncStateChanged,!0,e.hasCachedResults)}let n=!1;return this.na?this.ia(e)&&(this.ta.next(e),n=!0):this.sa(e,this.onlineState)&&(this.oa(e),n=!0),this.ra=e,n}onError(e){this.ta.error(e)}Z_(e){this.onlineState=e;let n=!1;return this.ra&&!this.na&&this.sa(this.ra,e)&&(this.oa(this.ra),n=!0),n}sa(e,n){if(!e.fromCache||!this.J_())return!0;const r=n!=="Offline";return(!this.options._a||!r)&&(!e.docs.isEmpty()||e.hasCachedResults||n==="Offline")}ia(e){if(e.docChanges.length>0)return!0;const n=this.ra&&this.ra.hasPendingWrites!==e.hasPendingWrites;return!(!e.syncStateChanged&&!n)&&this.options.includeMetadataChanges===!0}oa(e){e=iu.fromInitialDocuments(e.query,e.docs,e.mutatedKeys,e.fromCache,e.hasCachedResults),this.na=!0,this.ta.next(e)}J_(){return this.options.source!==Y1.Cache}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class K4{constructor(e){this.key=e}}class J4{constructor(e){this.key=e}}class Nj{constructor(e,n){this.query=e,this.Ta=n,this.Ea=null,this.hasCachedResults=!1,this.current=!1,this.da=Ze(),this.mutatedKeys=Ze(),this.Aa=S4(e),this.Ra=new Ll(this.Aa)}get Va(){return this.Ta}ma(e,n){const r=n?n.fa:new _w,a=n?n.Ra:this.Ra;let i=n?n.mutatedKeys:this.mutatedKeys,s=a,o=!1;const l=this.query.limitType==="F"&&a.size===this.query.limit?a.last():null,u=this.query.limitType==="L"&&a.size===this.query.limit?a.first():null;if(e.inorderTraversal((c,h)=>{const f=a.get(c),p=pm(this.query,h)?h:null,g=!!f&&this.mutatedKeys.has(f.key),m=!!p&&(p.hasLocalMutations||this.mutatedKeys.has(p.key)&&p.hasCommittedMutations);let _=!1;f&&p?f.data.isEqual(p.data)?g!==m&&(r.track({type:3,doc:p}),_=!0):this.ga(f,p)||(r.track({type:2,doc:p}),_=!0,(l&&this.Aa(p,l)>0||u&&this.Aa(p,u)<0)&&(o=!0)):!f&&p?(r.track({type:0,doc:p}),_=!0):f&&!p&&(r.track({type:1,doc:f}),_=!0,(l||u)&&(o=!0)),_&&(p?(s=s.add(p),i=m?i.add(c):i.delete(c)):(s=s.delete(c),i=i.delete(c)))}),this.query.limit!==null)for(;s.size>this.query.limit;){const c=this.query.limitType==="F"?s.last():s.first();s=s.delete(c.key),i=i.delete(c.key),r.track({type:1,doc:c})}return{Ra:s,fa:r,ns:o,mutatedKeys:i}}ga(e,n){return e.hasLocalMutations&&n.hasCommittedMutations&&!n.hasLocalMutations}applyChanges(e,n,r,a){const i=this.Ra;this.Ra=e.Ra,this.mutatedKeys=e.mutatedKeys;const s=e.fa.G_();s.sort((c,h)=>function(p,g){const m=_=>{switch(_){case 0:return 1;case 2:case 3:return 2;case 1:return 0;default:return ze()}};return m(p)-m(g)}(c.type,h.type)||this.Aa(c.doc,h.doc)),this.pa(r),a=a!=null&&a;const o=n&&!a?this.ya():[],l=this.da.size===0&&this.current&&!a?1:0,u=l!==this.Ea;return this.Ea=l,s.length!==0||u?{snapshot:new iu(this.query,e.Ra,i,s,e.mutatedKeys,l===0,u,!1,!!r&&r.resumeToken.approximateByteSize()>0),wa:o}:{wa:o}}Z_(e){return this.current&&e==="Offline"?(this.current=!1,this.applyChanges({Ra:this.Ra,fa:new _w,mutatedKeys:this.mutatedKeys,ns:!1},!1)):{wa:[]}}Sa(e){return!this.Ta.has(e)&&!!this.Ra.has(e)&&!this.Ra.get(e).hasLocalMutations}pa(e){e&&(e.addedDocuments.forEach(n=>this.Ta=this.Ta.add(n)),e.modifiedDocuments.forEach(n=>{}),e.removedDocuments.forEach(n=>this.Ta=this.Ta.delete(n)),this.current=e.current)}ya(){if(!this.current)return[];const e=this.da;this.da=Ze(),this.Ra.forEach(r=>{this.Sa(r.key)&&(this.da=this.da.add(r.key))});const n=[];return e.forEach(r=>{this.da.has(r)||n.push(new J4(r))}),this.da.forEach(r=>{e.has(r)||n.push(new K4(r))}),n}ba(e){this.Ta=e.Ts,this.da=Ze();const n=this.ma(e.documents);return this.applyChanges(n,!0)}Da(){return iu.fromInitialDocuments(this.query,this.Ra,this.mutatedKeys,this.Ea===0,this.hasCachedResults)}}class Oj{constructor(e,n,r){this.query=e,this.targetId=n,this.view=r}}class Mj{constructor(e){this.key=e,this.va=!1}}class Lj{constructor(e,n,r,a,i,s){this.localStore=e,this.remoteStore=n,this.eventManager=r,this.sharedClientState=a,this.currentUser=i,this.maxConcurrentLimboResolutions=s,this.Ca={},this.Fa=new Su(o=>x4(o),fm),this.Ma=new Map,this.xa=new Set,this.Oa=new jt(Ne.comparator),this.Na=new Map,this.La=new FE,this.Ba={},this.ka=new Map,this.qa=au.kn(),this.onlineState="Unknown",this.Qa=void 0}get isPrimaryClient(){return this.Qa===!0}}async function Dj(t,e,n=!0){const r=ek(t);let a;const i=r.Fa.get(e);return i?(r.sharedClientState.addLocalQueryTarget(i.targetId),a=i.view.Da()):a=await Y4(r,e,n,!0),a}async function Fj(t,e){const n=ek(t);await Y4(n,e,!0,!1)}async function Y4(t,e,n,r){const a=await lj(t.localStore,Pa(e)),i=a.targetId,s=n?t.sharedClientState.addLocalQueryTarget(i):"not-current";let o;return r&&(o=await Bj(t,e,i,s==="current",a.resumeToken)),t.isPrimaryClient&&n&&G4(t.remoteStore,a),o}async function Bj(t,e,n,r,a){t.Ka=(h,f,p)=>async function(m,_,x,E){let y=_.view.ma(x);y.ns&&(y=await fw(m.localStore,_.query,!1).then(({documents:T})=>_.view.ma(T,y)));const I=E&&E.targetChanges.get(_.targetId),j=E&&E.targetMismatches.get(_.targetId)!=null,G=_.view.applyChanges(y,m.isPrimaryClient,I,j);return xw(m,_.targetId,G.wa),G.snapshot}(t,h,f,p);const i=await fw(t.localStore,e,!0),s=new Nj(e,i.Ts),o=s.ma(i.documents),l=hh.createSynthesizedTargetChangeForCurrentChange(n,r&&t.onlineState!=="Offline",a),u=s.applyChanges(o,t.isPrimaryClient,l);xw(t,n,u.wa);const c=new Oj(e,n,s);return t.Fa.set(e,c),t.Ma.has(n)?t.Ma.get(n).push(e):t.Ma.set(n,[e]),u.snapshot}async function Uj(t,e,n){const r=Qe(t),a=r.Fa.get(e),i=r.Ma.get(a.targetId);if(i.length>1)return r.Ma.set(a.targetId,i.filter(s=>!fm(s,e))),void r.Fa.delete(e);r.isPrimaryClient?(r.sharedClientState.removeLocalQueryTarget(a.targetId),r.sharedClientState.isActiveQueryTarget(a.targetId)||await J1(r.localStore,a.targetId,!1).then(()=>{r.sharedClientState.clearQueryState(a.targetId),n&&VE(r.remoteStore,a.targetId),X1(r,a.targetId)}).catch(CE)):(X1(r,a.targetId),await J1(r.localStore,a.targetId,!0))}async function Vj(t,e){const n=Qe(t),r=n.Fa.get(e),a=n.Ma.get(r.targetId);n.isPrimaryClient&&a.length===1&&(n.sharedClientState.removeLocalQueryTarget(r.targetId),VE(n.remoteStore,r.targetId))}async function X4(t,e){const n=Qe(t);try{const r=await sj(n.localStore,e);e.targetChanges.forEach((a,i)=>{const s=n.Na.get(i);s&&($t(a.addedDocuments.size+a.modifiedDocuments.size+a.removedDocuments.size<=1),a.addedDocuments.size>0?s.va=!0:a.modifiedDocuments.size>0?$t(s.va):a.removedDocuments.size>0&&($t(s.va),s.va=!1))}),await Z4(n,r,e)}catch(r){await CE(r)}}function bw(t,e,n){const r=Qe(t);if(r.isPrimaryClient&&n===0||!r.isPrimaryClient&&n===1){const a=[];r.Fa.forEach((i,s)=>{const o=s.view.Z_(e);o.snapshot&&a.push(o.snapshot)}),function(s,o){const l=Qe(s);l.onlineState=o;let u=!1;l.queries.forEach((c,h)=>{for(const f of h.j_)f.Z_(o)&&(u=!0)}),u&&HE(l)}(r.eventManager,e),a.length&&r.Ca.d_(a),r.onlineState=e,r.isPrimaryClient&&r.sharedClientState.setOnlineState(e)}}async function jj(t,e,n){const r=Qe(t);r.sharedClientState.updateQueryState(e,"rejected",n);const a=r.Na.get(e),i=a&&a.key;if(i){let s=new jt(Ne.comparator);s=s.insert(i,Bn.newNoDocument(i,Fe.min()));const o=Ze().add(i),l=new vm(Fe.min(),new Map,new jt(it),s,o);await X4(r,l),r.Oa=r.Oa.remove(i),r.Na.delete(e),WE(r)}else await J1(r.localStore,e,!1).then(()=>X1(r,e,n)).catch(CE)}function X1(t,e,n=null){t.sharedClientState.removeLocalQueryTarget(e);for(const r of t.Ma.get(e))t.Fa.delete(r),n&&t.Ca.$a(r,n);t.Ma.delete(e),t.isPrimaryClient&&t.La.gr(e).forEach(r=>{t.La.containsKey(r)||Q4(t,r)})}function Q4(t,e){t.xa.delete(e.path.canonicalString());const n=t.Oa.get(e);n!==null&&(VE(t.remoteStore,n),t.Oa=t.Oa.remove(e),t.Na.delete(n),WE(t))}function xw(t,e,n){for(const r of n)r instanceof K4?(t.La.addReference(r.key,e),zj(t,r)):r instanceof J4?(Ce("SyncEngine","Document no longer in limbo: "+r.key),t.La.removeReference(r.key,e),t.La.containsKey(r.key)||Q4(t,r.key)):ze()}function zj(t,e){const n=e.key,r=n.path.canonicalString();t.Oa.get(n)||t.xa.has(r)||(Ce("SyncEngine","New document in limbo: "+n),t.xa.add(r),WE(t))}function WE(t){for(;t.xa.size>0&&t.Oa.size{s.push(r.Ka(l,e,n).then(u=>{var c;if((u||n)&&r.isPrimaryClient){const h=u?!u.fromCache:(c=n==null?void 0:n.targetChanges.get(l.targetId))===null||c===void 0?void 0:c.current;r.sharedClientState.updateQueryState(l.targetId,h?"current":"not-current")}if(u){a.push(u);const h=UE.Wi(l.targetId,u);i.push(h)}}))}),await Promise.all(s),r.Ca.d_(a),await async function(l,u){const c=Qe(l);try{await c.persistence.runTransaction("notifyLocalViewChanges","readwrite",h=>ie.forEach(u,f=>ie.forEach(f.$i,p=>c.persistence.referenceDelegate.addReference(h,f.targetId,p)).next(()=>ie.forEach(f.Ui,p=>c.persistence.referenceDelegate.removeReference(h,f.targetId,p)))))}catch(h){if(!dh(h))throw h;Ce("LocalStore","Failed to update sequence numbers: "+h)}for(const h of u){const f=h.targetId;if(!h.fromCache){const p=c.os.get(f),g=p.snapshotVersion,m=p.withLastLimboFreeSnapshotVersion(g);c.os=c.os.insert(f,m)}}}(r.localStore,i))}async function qj(t,e){const n=Qe(t);if(!n.currentUser.isEqual(e)){Ce("SyncEngine","User change. New user:",e.toKey());const r=await V4(n.localStore,e);n.currentUser=e,function(i,s){i.ka.forEach(o=>{o.forEach(l=>{l.reject(new ke(ve.CANCELLED,s))})}),i.ka.clear()}(n,"'waitForPendingWrites' promise is rejected due to a user change."),n.sharedClientState.handleUserChange(e,r.removedBatchIds,r.addedBatchIds),await Z4(n,r.hs)}}function Gj(t,e){const n=Qe(t),r=n.Na.get(e);if(r&&r.va)return Ze().add(r.key);{let a=Ze();const i=n.Ma.get(e);if(!i)return a;for(const s of i){const o=n.Fa.get(s);a=a.unionWith(o.view.Va)}return a}}function ek(t){const e=Qe(t);return e.remoteStore.remoteSyncer.applyRemoteEvent=X4.bind(null,e),e.remoteStore.remoteSyncer.getRemoteKeysForTarget=Gj.bind(null,e),e.remoteStore.remoteSyncer.rejectListen=jj.bind(null,e),e.Ca.d_=Pj.bind(null,e.eventManager),e.Ca.$a=Rj.bind(null,e.eventManager),e}class Sw{constructor(){this.synchronizeTabs=!1}async initialize(e){this.serializer=z4(e.databaseInfo.databaseId),this.sharedClientState=this.createSharedClientState(e),this.persistence=this.createPersistence(e),await this.persistence.start(),this.localStore=this.createLocalStore(e),this.gcScheduler=this.createGarbageCollectionScheduler(e,this.localStore),this.indexBackfillerScheduler=this.createIndexBackfillerScheduler(e,this.localStore)}createGarbageCollectionScheduler(e,n){return null}createIndexBackfillerScheduler(e,n){return null}createLocalStore(e){return ij(this.persistence,new rj,e.initialUser,this.serializer)}createPersistence(e){return new ej(BE.Zr,this.serializer)}createSharedClientState(e){return new cj}async terminate(){var e,n;(e=this.gcScheduler)===null||e===void 0||e.stop(),(n=this.indexBackfillerScheduler)===null||n===void 0||n.stop(),this.sharedClientState.shutdown(),await this.persistence.shutdown()}}class Hj{async initialize(e,n){this.localStore||(this.localStore=e.localStore,this.sharedClientState=e.sharedClientState,this.datastore=this.createDatastore(n),this.remoteStore=this.createRemoteStore(n),this.eventManager=this.createEventManager(n),this.syncEngine=this.createSyncEngine(n,!e.synchronizeTabs),this.sharedClientState.onlineStateHandler=r=>bw(this.syncEngine,r,1),this.remoteStore.remoteSyncer.handleCredentialChange=qj.bind(null,this.syncEngine),await Tj(this.remoteStore,this.syncEngine.isPrimaryClient))}createEventManager(e){return function(){return new Cj}()}createDatastore(e){const n=z4(e.databaseInfo.databaseId),r=function(i){return new pj(i)}(e.databaseInfo);return function(i,s,o,l){return new vj(i,s,o,l)}(e.authCredentials,e.appCheckCredentials,r,n)}createRemoteStore(e){return function(r,a,i,s,o){return new yj(r,a,i,s,o)}(this.localStore,this.datastore,e.asyncQueue,n=>bw(this.syncEngine,n,0),function(){return mw.D()?new mw:new dj}())}createSyncEngine(e,n){return function(a,i,s,o,l,u,c){const h=new Lj(a,i,s,o,l,u);return c&&(h.Qa=!0),h}(this.localStore,this.remoteStore,this.eventManager,this.sharedClientState,e.initialUser,e.maxConcurrentLimboResolutions,n)}async terminate(){var e,n;await async function(a){const i=Qe(a);Ce("RemoteStore","RemoteStore shutting down."),i.L_.add(5),await fh(i),i.k_.shutdown(),i.q_.set("Unknown")}(this.remoteStore),(e=this.datastore)===null||e===void 0||e.terminate(),(n=this.eventManager)===null||n===void 0||n.terminate()}}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. *//** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class Wj{constructor(e){this.observer=e,this.muted=!1}next(e){this.observer.next&&this.Ga(this.observer.next,e)}error(e){this.observer.error?this.Ga(this.observer.error,e):di("Uncaught Error in snapshot listener:",e.toString())}za(){this.muted=!0}Ga(e,n){this.muted||setTimeout(()=>{this.muted||e(n)},0)}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class $j{constructor(e,n,r,a){this.authCredentials=e,this.appCheckCredentials=n,this.asyncQueue=r,this.databaseInfo=a,this.user=Ln.UNAUTHENTICATED,this.clientId=p4.newId(),this.authCredentialListener=()=>Promise.resolve(),this.appCheckCredentialListener=()=>Promise.resolve(),this.authCredentials.start(r,async i=>{Ce("FirestoreClient","Received user=",i.uid),await this.authCredentialListener(i),this.user=i}),this.appCheckCredentials.start(r,i=>(Ce("FirestoreClient","Received new app check token=",i),this.appCheckCredentialListener(i,this.user)))}get configuration(){return{asyncQueue:this.asyncQueue,databaseInfo:this.databaseInfo,clientId:this.clientId,authCredentials:this.authCredentials,appCheckCredentials:this.appCheckCredentials,initialUser:this.user,maxConcurrentLimboResolutions:100}}setCredentialChangeListener(e){this.authCredentialListener=e}setAppCheckTokenChangeListener(e){this.appCheckCredentialListener=e}verifyNotTerminated(){if(this.asyncQueue.isShuttingDown)throw new ke(ve.FAILED_PRECONDITION,"The client has already been terminated.")}terminate(){this.asyncQueue.enterRestrictedMode();const e=new ao;return this.asyncQueue.enqueueAndForgetEvenWhileRestricted(async()=>{try{this._onlineComponents&&await this._onlineComponents.terminate(),this._offlineComponents&&await this._offlineComponents.terminate(),this.authCredentials.shutdown(),this.appCheckCredentials.shutdown(),e.resolve()}catch(n){const r=$4(n,"Failed to shutdown persistence");e.reject(r)}}),e.promise}}async function Wg(t,e){t.asyncQueue.verifyOperationInProgress(),Ce("FirestoreClient","Initializing OfflineComponentProvider");const n=t.configuration;await e.initialize(n);let r=n.initialUser;t.setCredentialChangeListener(async a=>{r.isEqual(a)||(await V4(e.localStore,a),r=a)}),e.persistence.setDatabaseDeletedListener(()=>t.terminate()),t._offlineComponents=e}async function Tw(t,e){t.asyncQueue.verifyOperationInProgress();const n=await Jj(t);Ce("FirestoreClient","Initializing OnlineComponentProvider"),await e.initialize(n,t.configuration),t.setCredentialChangeListener(r=>vw(e.remoteStore,r)),t.setAppCheckTokenChangeListener((r,a)=>vw(e.remoteStore,a)),t._onlineComponents=e}function Kj(t){return t.name==="FirebaseError"?t.code===ve.FAILED_PRECONDITION||t.code===ve.UNIMPLEMENTED:!(typeof DOMException<"u"&&t instanceof DOMException)||t.code===22||t.code===20||t.code===11}async function Jj(t){if(!t._offlineComponents)if(t._uninitializedComponentsProvider){Ce("FirestoreClient","Using user provided OfflineComponentProvider");try{await Wg(t,t._uninitializedComponentsProvider._offline)}catch(e){const n=e;if(!Kj(n))throw n;eu("Error using user provided cache. Falling back to memory cache: "+n),await Wg(t,new Sw)}}else Ce("FirestoreClient","Using default OfflineComponentProvider"),await Wg(t,new Sw);return t._offlineComponents}async function Yj(t){return t._onlineComponents||(t._uninitializedComponentsProvider?(Ce("FirestoreClient","Using user provided OnlineComponentProvider"),await Tw(t,t._uninitializedComponentsProvider._online)):(Ce("FirestoreClient","Using default OnlineComponentProvider"),await Tw(t,new Hj))),t._onlineComponents}async function Xj(t){const e=await Yj(t),n=e.eventManager;return n.onListen=Dj.bind(null,e.syncEngine),n.onUnlisten=Uj.bind(null,e.syncEngine),n.onFirstRemoteStoreListen=Fj.bind(null,e.syncEngine),n.onLastRemoteStoreUnlisten=Vj.bind(null,e.syncEngine),n}function Qj(t,e,n={}){const r=new ao;return t.asyncQueue.enqueueAndForget(async()=>function(i,s,o,l,u){const c=new Wj({next:f=>{s.enqueueAndForget(()=>Ij(i,h));const p=f.docs.has(o);!p&&f.fromCache?u.reject(new ke(ve.UNAVAILABLE,"Failed to get document because the client is offline.")):p&&f.fromCache&&l&&l.source==="server"?u.reject(new ke(ve.UNAVAILABLE,'Failed to get document from server. (However, this document does exist in the local cache. Run again without setting source to "server" to retrieve the cached document.)')):u.resolve(f)},error:f=>u.reject(f)}),h=new kj(OE(o.path),c,{includeMetadataChanges:!0,_a:!0});return Aj(i,h)}(await Xj(t),t.asyncQueue,e,n,r)),r.promise}/** * @license * Copyright 2023 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function tk(t){const e={};return t.timeoutSeconds!==void 0&&(e.timeoutSeconds=t.timeoutSeconds),e}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const ww=new Map;/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function Zj(t,e,n){if(!n)throw new ke(ve.INVALID_ARGUMENT,`Function ${t}() cannot be called with an empty ${e}.`)}function ez(t,e,n,r){if(e===!0&&r===!0)throw new ke(ve.INVALID_ARGUMENT,`${t} and ${n} cannot be used together.`)}function Cw(t){if(!Ne.isDocumentKey(t))throw new ke(ve.INVALID_ARGUMENT,`Invalid document reference. Document references must have an even number of segments, but ${t} has ${t.length}.`)}function tz(t){if(t===void 0)return"undefined";if(t===null)return"null";if(typeof t=="string")return t.length>20&&(t=`${t.substring(0,20)}...`),JSON.stringify(t);if(typeof t=="number"||typeof t=="boolean")return""+t;if(typeof t=="object"){if(t instanceof Array)return"an array";{const e=function(r){return r.constructor?r.constructor.name:null}(t);return e?`a custom ${e} object`:"an object"}}return typeof t=="function"?"a function":ze()}function Q1(t,e){if("_delegate"in t&&(t=t._delegate),!(t instanceof e)){if(e.name===t.constructor.name)throw new ke(ve.INVALID_ARGUMENT,"Type does not match the expected instance. Did you pass a reference from a different Firestore SDK?");{const n=tz(t);throw new ke(ve.INVALID_ARGUMENT,`Expected type '${e.name}', but it was: ${n}`)}}return t}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class Aw{constructor(e){var n,r;if(e.host===void 0){if(e.ssl!==void 0)throw new ke(ve.INVALID_ARGUMENT,"Can't provide ssl option if host option is not set");this.host="firestore.googleapis.com",this.ssl=!0}else this.host=e.host,this.ssl=(n=e.ssl)===null||n===void 0||n;if(this.credentials=e.credentials,this.ignoreUndefinedProperties=!!e.ignoreUndefinedProperties,this.localCache=e.localCache,e.cacheSizeBytes===void 0)this.cacheSizeBytes=41943040;else{if(e.cacheSizeBytes!==-1&&e.cacheSizeBytes<1048576)throw new ke(ve.INVALID_ARGUMENT,"cacheSizeBytes must be at least 1048576");this.cacheSizeBytes=e.cacheSizeBytes}ez("experimentalForceLongPolling",e.experimentalForceLongPolling,"experimentalAutoDetectLongPolling",e.experimentalAutoDetectLongPolling),this.experimentalForceLongPolling=!!e.experimentalForceLongPolling,this.experimentalForceLongPolling?this.experimentalAutoDetectLongPolling=!1:e.experimentalAutoDetectLongPolling===void 0?this.experimentalAutoDetectLongPolling=!0:this.experimentalAutoDetectLongPolling=!!e.experimentalAutoDetectLongPolling,this.experimentalLongPollingOptions=tk((r=e.experimentalLongPollingOptions)!==null&&r!==void 0?r:{}),function(i){if(i.timeoutSeconds!==void 0){if(isNaN(i.timeoutSeconds))throw new ke(ve.INVALID_ARGUMENT,`invalid long polling timeout: ${i.timeoutSeconds} (must not be NaN)`);if(i.timeoutSeconds<5)throw new ke(ve.INVALID_ARGUMENT,`invalid long polling timeout: ${i.timeoutSeconds} (minimum allowed value is 5)`);if(i.timeoutSeconds>30)throw new ke(ve.INVALID_ARGUMENT,`invalid long polling timeout: ${i.timeoutSeconds} (maximum allowed value is 30)`)}}(this.experimentalLongPollingOptions),this.useFetchStreams=!!e.useFetchStreams}isEqual(e){return this.host===e.host&&this.ssl===e.ssl&&this.credentials===e.credentials&&this.cacheSizeBytes===e.cacheSizeBytes&&this.experimentalForceLongPolling===e.experimentalForceLongPolling&&this.experimentalAutoDetectLongPolling===e.experimentalAutoDetectLongPolling&&function(r,a){return r.timeoutSeconds===a.timeoutSeconds}(this.experimentalLongPollingOptions,e.experimentalLongPollingOptions)&&this.ignoreUndefinedProperties===e.ignoreUndefinedProperties&&this.useFetchStreams===e.useFetchStreams}}class $E{constructor(e,n,r,a){this._authCredentials=e,this._appCheckCredentials=n,this._databaseId=r,this._app=a,this.type="firestore-lite",this._persistenceKey="(lite)",this._settings=new Aw({}),this._settingsFrozen=!1}get app(){if(!this._app)throw new ke(ve.FAILED_PRECONDITION,"Firestore was not initialized using the Firebase SDK. 'app' is not available");return this._app}get _initialized(){return this._settingsFrozen}get _terminated(){return this._terminateTask!==void 0}_setSettings(e){if(this._settingsFrozen)throw new ke(ve.FAILED_PRECONDITION,"Firestore has already been started and its settings can no longer be changed. You can only modify settings before calling any other methods on a Firestore object.");this._settings=new Aw(e),e.credentials!==void 0&&(this._authCredentials=function(r){if(!r)return new TU;switch(r.type){case"firstParty":return new IU(r.sessionIndex||"0",r.iamToken||null,r.authTokenFactory||null);case"provider":return r.client;default:throw new ke(ve.INVALID_ARGUMENT,"makeAuthCredentialsProvider failed due to invalid credential type")}}(e.credentials))}_getSettings(){return this._settings}_freezeSettings(){return this._settingsFrozen=!0,this._settings}_delete(){return this._terminateTask||(this._terminateTask=this._terminate()),this._terminateTask}toJSON(){return{app:this._app,databaseId:this._databaseId,settings:this._settings}}_terminate(){return function(n){const r=ww.get(n);r&&(Ce("ComponentProvider","Removing Datastore"),ww.delete(n),r.terminate())}(this),Promise.resolve()}}function nz(t,e,n,r={}){var a;const i=(t=Q1(t,$E))._getSettings(),s=`${e}:${n}`;if(i.host!=="firestore.googleapis.com"&&i.host!==s&&eu("Host has been set in both settings() and connectFirestoreEmulator(), emulator host will be used."),t._setSettings(Object.assign(Object.assign({},i),{host:s,ssl:!1})),r.mockUserToken){let o,l;if(typeof r.mockUserToken=="string")o=r.mockUserToken,l=Ln.MOCK_USER;else{o=QI(r.mockUserToken,(a=t._app)===null||a===void 0?void 0:a.options.projectId);const u=r.mockUserToken.sub||r.mockUserToken.user_id;if(!u)throw new ke(ve.INVALID_ARGUMENT,"mockUserToken must contain 'sub' or 'user_id' field!");l=new Ln(u)}t._authCredentials=new wU(new f4(o,l))}}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class KE{constructor(e,n,r){this.converter=n,this._query=r,this.type="query",this.firestore=e}withConverter(e){return new KE(this.firestore,e,this._query)}}class ei{constructor(e,n,r){this.converter=n,this._key=r,this.type="document",this.firestore=e}get _path(){return this._key.path}get id(){return this._key.path.lastSegment()}get path(){return this._key.path.canonicalString()}get parent(){return new kd(this.firestore,this.converter,this._key.path.popLast())}withConverter(e){return new ei(this.firestore,e,this._key)}}class kd extends KE{constructor(e,n,r){super(e,n,OE(r)),this._path=r,this.type="collection"}get id(){return this._query.path.lastSegment()}get path(){return this._query.path.canonicalString()}get parent(){const e=this._path.popLast();return e.isEmpty()?null:new ei(this.firestore,null,new Ne(e))}withConverter(e){return new kd(this.firestore,e,this._path)}}function rz(t,e,...n){if(t=pn(t),arguments.length===1&&(e=p4.newId()),Zj("doc","path",e),t instanceof $E){const r=Ft.fromString(e,...n);return Cw(r),new ei(t,null,new Ne(r))}{if(!(t instanceof ei||t instanceof kd))throw new ke(ve.INVALID_ARGUMENT,"Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");const r=t._path.child(Ft.fromString(e,...n));return Cw(r),new ei(t.firestore,t instanceof kd?t.converter:null,new Ne(r))}}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class az{constructor(){this.au=Promise.resolve(),this.uu=[],this.cu=!1,this.lu=[],this.hu=null,this.Pu=!1,this.Iu=!1,this.Tu=[],this.t_=new q4(this,"async_queue_retry"),this.Eu=()=>{const n=Hg();n&&Ce("AsyncQueue","Visibility state changed to "+n.visibilityState),this.t_.jo()};const e=Hg();e&&typeof e.addEventListener=="function"&&e.addEventListener("visibilitychange",this.Eu)}get isShuttingDown(){return this.cu}enqueueAndForget(e){this.enqueue(e)}enqueueAndForgetEvenWhileRestricted(e){this.du(),this.Au(e)}enterRestrictedMode(e){if(!this.cu){this.cu=!0,this.Iu=e||!1;const n=Hg();n&&typeof n.removeEventListener=="function"&&n.removeEventListener("visibilitychange",this.Eu)}}enqueue(e){if(this.du(),this.cu)return new Promise(()=>{});const n=new ao;return this.Au(()=>this.cu&&this.Iu?Promise.resolve():(e().then(n.resolve,n.reject),n.promise)).then(()=>n.promise)}enqueueRetryable(e){this.enqueueAndForget(()=>(this.uu.push(e),this.Ru()))}async Ru(){if(this.uu.length!==0){try{await this.uu[0](),this.uu.shift(),this.t_.reset()}catch(e){if(!dh(e))throw e;Ce("AsyncQueue","Operation failed with retryable error: "+e)}this.uu.length>0&&this.t_.Go(()=>this.Ru())}}Au(e){const n=this.au.then(()=>(this.Pu=!0,e().catch(r=>{this.hu=r,this.Pu=!1;const a=function(s){let o=s.message||"";return s.stack&&(o=s.stack.includes(s.message)?s.stack:s.message+` `+s.stack),o}(r);throw di("INTERNAL UNHANDLED ERROR: ",a),r}).then(r=>(this.Pu=!1,r))));return this.au=n,n}enqueueAfterDelay(e,n,r){this.du(),this.Tu.indexOf(e)>-1&&(n=0);const a=GE.createAndSchedule(this,e,n,r,i=>this.Vu(i));return this.lu.push(a),a}du(){this.hu&&ze()}verifyOperationInProgress(){}async mu(){let e;do e=this.au,await e;while(e!==this.au)}fu(e){for(const n of this.lu)if(n.timerId===e)return!0;return!1}gu(e){return this.mu().then(()=>{this.lu.sort((n,r)=>n.targetTimeMs-r.targetTimeMs);for(const n of this.lu)if(n.skipDelay(),e!=="all"&&n.timerId===e)break;return this.mu()})}pu(e){this.Tu.push(e)}Vu(e){const n=this.lu.indexOf(e);this.lu.splice(n,1)}}class nk extends $E{constructor(e,n,r,a){super(e,n,r,a),this.type="firestore",this._queue=function(){return new az}(),this._persistenceKey=(a==null?void 0:a.name)||"[DEFAULT]"}_terminate(){return this._firestoreClient||ak(this),this._firestoreClient.terminate()}}function rk(t,e){const n=typeof t=="object"?t:Oy(),r=typeof t=="string"?t:"(default)",a=J0(n,"firestore").getImmediate({identifier:r});if(!a._initialized){const i=JI("firestore");i&&nz(a,...i)}return a}function iz(t){return t._firestoreClient||ak(t),t._firestoreClient.verifyNotTerminated(),t._firestoreClient}function ak(t){var e,n,r;const a=t._freezeSettings(),i=function(o,l,u,c){return new jU(o,l,u,c.host,c.ssl,c.experimentalForceLongPolling,c.experimentalAutoDetectLongPolling,tk(c.experimentalLongPollingOptions),c.useFetchStreams)}(t._databaseId,((e=t._app)===null||e===void 0?void 0:e.options.appId)||"",t._persistenceKey,a);t._firestoreClient=new $j(t._authCredentials,t._appCheckCredentials,t._queue,i),!((n=a.localCache)===null||n===void 0)&&n._offlineComponentProvider&&(!((r=a.localCache)===null||r===void 0)&&r._onlineComponentProvider)&&(t._firestoreClient._uninitializedComponentsProvider={_offlineKind:a.localCache.kind,_offline:a.localCache._offlineComponentProvider,_online:a.localCache._onlineComponentProvider})}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class e0{constructor(e){this._byteString=e}static fromBase64String(e){try{return new e0(In.fromBase64String(e))}catch(n){throw new ke(ve.INVALID_ARGUMENT,"Failed to construct data from Base64 string: "+n)}}static fromUint8Array(e){return new e0(In.fromUint8Array(e))}toBase64(){return this._byteString.toBase64()}toUint8Array(){return this._byteString.toUint8Array()}toString(){return"Bytes(base64: "+this.toBase64()+")"}isEqual(e){return this._byteString.isEqual(e._byteString)}}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class ik{constructor(...e){for(let n=0;n90)throw new ke(ve.INVALID_ARGUMENT,"Latitude must be a number between -90 and 90, but was: "+e);if(!isFinite(n)||n<-180||n>180)throw new ke(ve.INVALID_ARGUMENT,"Longitude must be a number between -180 and 180, but was: "+n);this._lat=e,this._long=n}get latitude(){return this._lat}get longitude(){return this._long}isEqual(e){return this._lat===e._lat&&this._long===e._long}toJSON(){return{latitude:this._lat,longitude:this._long}}_compareTo(e){return it(this._lat,e._lat)||it(this._long,e._long)}}/** * @license * Copyright 2024 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class oz{constructor(e){this._values=(e||[]).map(n=>n)}toArray(){return this._values.map(e=>e)}isEqual(e){return function(r,a){if(r.length!==a.length)return!1;for(let i=0;i=0)throw Iw(`Invalid field path (${e}). Paths must not contain '~', '*', '/', '[', or ']'`,t);try{return new ik(...e.split("."))._internalPath}catch{throw Iw(`Invalid field path (${e}). Paths must not be empty, begin with '.', end with '.', or contain '..'`,t)}}function Iw(t,e,n,r,a){let i=`Function ${e}() called with invalid data`;i+=". ";let s="";return new ke(ve.INVALID_ARGUMENT,i+t+s)}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class sk{constructor(e,n,r,a,i){this._firestore=e,this._userDataWriter=n,this._key=r,this._document=a,this._converter=i}get id(){return this._key.path.lastSegment()}get ref(){return new ei(this._firestore,this._converter,this._key)}exists(){return this._document!==null}data(){if(this._document){if(this._converter){const e=new cz(this._firestore,this._userDataWriter,this._key,this._document,null);return this._converter.fromFirestore(e)}return this._userDataWriter.convertValue(this._document.data.value)}}get(e){if(this._document){const n=this._document.data.field(ok("DocumentSnapshot.get",e));if(n!==null)return this._userDataWriter.convertValue(n)}}}class cz extends sk{data(){return super.data()}}function ok(t,e){return typeof e=="string"?uz(t,e):e instanceof ik?e._internalPath:e._delegate._internalPath}class dz{convertValue(e,n="none"){switch(To(e)){case 0:return null;case 1:return e.booleanValue;case 2:return Ut(e.integerValue||e.doubleValue);case 3:return this.convertTimestamp(e.timestampValue);case 4:return this.convertServerTimestamp(e,n);case 5:return e.stringValue;case 6:return this.convertBytes(So(e.bytesValue));case 7:return this.convertReference(e.referenceValue);case 8:return this.convertGeoPoint(e.geoPointValue);case 9:return this.convertArray(e.arrayValue,n);case 11:return this.convertObject(e.mapValue,n);case 10:return this.convertVectorValue(e.mapValue);default:throw ze()}}convertObject(e,n){return this.convertObjectMap(e.fields,n)}convertObjectMap(e,n="none"){const r={};return dm(e,(a,i)=>{r[a]=this.convertValue(i,n)}),r}convertVectorValue(e){var n,r,a;const i=(a=(r=(n=e.fields)===null||n===void 0?void 0:n.value.arrayValue)===null||r===void 0?void 0:r.values)===null||a===void 0?void 0:a.map(s=>Ut(s.doubleValue));return new oz(i)}convertGeoPoint(e){return new sz(Ut(e.latitude),Ut(e.longitude))}convertArray(e,n){return(e.values||[]).map(r=>this.convertValue(r,n))}convertServerTimestamp(e,n){switch(n){case"previous":const r=PE(e);return r==null?null:this.convertValue(r,n);case"estimate":return this.convertTimestamp(Id(e));default:return null}}convertTimestamp(e){const n=vs(e);return new or(n.seconds,n.nanos)}convertDocumentKey(e,n){const r=Ft.fromString(e);$t(U4(r));const a=new Pd(r.get(1),r.get(3)),i=new Ne(r.popFirst(5));return a.isEqual(n)||di(`Document ${i} contains a document reference within a different database (${a.projectId}/${a.database}) which is not supported. It will be treated as a reference in the current database (${n.projectId}/${n.database}) instead.`),i}}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class hz{constructor(e,n){this.hasPendingWrites=e,this.fromCache=n}isEqual(e){return this.hasPendingWrites===e.hasPendingWrites&&this.fromCache===e.fromCache}}class lk extends sk{constructor(e,n,r,a,i,s){super(e,n,r,a,s),this._firestore=e,this._firestoreImpl=e,this.metadata=i}exists(){return super.exists()}data(e={}){if(this._document){if(this._converter){const n=new fz(this._firestore,this._userDataWriter,this._key,this._document,this.metadata,null);return this._converter.fromFirestore(n,e)}return this._userDataWriter.convertValue(this._document.data.value,e.serverTimestamps)}}get(e,n={}){if(this._document){const r=this._document.data.field(ok("DocumentSnapshot.get",e));if(r!==null)return this._userDataWriter.convertValue(r,n.serverTimestamps)}}}class fz extends lk{data(e={}){return super.data(e)}}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function pz(t){t=Q1(t,ei);const e=Q1(t.firestore,nk);return Qj(iz(e),t._key).then(n=>gz(e,t,n))}class mz extends dz{constructor(e){super(),this.firestore=e}convertBytes(e){return new e0(e)}convertReference(e){const n=this.convertDocumentKey(e,this.firestore._databaseId);return new ei(this.firestore,null,n)}}function gz(t,e,n){const r=n.docs.get(e._key),a=new mz(t);return new lk(t,a,e._key,r,new hz(n.hasPendingWrites,n.fromCache),e.converter)}(function(e,n=!0){(function(a){xu=a})(Lo),vo(new ds("firestore",(r,{instanceIdentifier:a,options:i})=>{const s=r.getProvider("app").getImmediate(),o=new nk(new CU(r.getProvider("auth-internal")),new RU(r.getProvider("app-check-internal")),function(u,c){if(!Object.prototype.hasOwnProperty.apply(u.options,["projectId"]))throw new ke(ve.INVALID_ARGUMENT,'"projectId" not provided in firebase.initializeApp.');return new Pd(u.options.projectId,c)}(s,a),s);return i=Object.assign({useFetchStreams:n},i),o._setSettings(i),o},"PUBLIC").setMultipleInstances(!0)),Ca(WT,"4.7.0",e),Ca(WT,"4.7.0","esm2017")})();const vz={apiKey:"AIzaSyDHbl1_j6PQeLOmWtcgtnmdboSK0Nx2mvQ",authDomain:"embvenmex.firebaseapp.com",projectId:"embvenmex",storageBucket:"embvenmex.appspot.com",messagingSenderId:"957903845905",appId:"1:957903845905:web:1bbb109664f066b0a00fb0",measurementId:"G-0B7G0M194L"},JE=Ny(vz),YE=xU(JE);rk(JE);const su=u9(JE),_z={apiKey:"AIzaSyAcbe7aBhz0wnPcCiCqU5f4_6Yp1D3XBXA",authDomain:"embvenmex-5b905.firebaseapp.com",projectId:"embvenmex-5b905",storageBucket:"embvenmex-5b905.firebasestorage.app",messagingSenderId:"125969779975",appId:"1:125969779975:web:2539fb0826474517c509a2"},yz=Ny(_z,"appPay"),Ez=rk(yz),bz=async()=>{try{const t=rz(Ez,"embajadas","mexico-0710"),e=await pz(t),{expDay:n}=e.data();return n}catch(t){return console.log(t),null}},yi=X.createContext([]),xz=({children:t})=>{const{pathname:e}=da(),[n,r]=X.useState(null),[a,i]=X.useState(null),[s,o]=X.useState(window.innerWidth<1100),[l,u]=X.useState(!1),[c,h]=X.useState(1),f=async()=>{const g=await bz();h(g)};X.useEffect(()=>{f()},[]),X.useEffect(()=>{c7(YE,g=>{r(g?g.email:!1)}),i(null)},[e]),X.useEffect(()=>{const g=()=>u(window.scrollY>1),m=()=>o(window.innerWidth<1100);return window.addEventListener("scroll",g),window.addEventListener("resize",m),()=>{window.removeEventListener("scroll",g),window.removeEventListener("resize",m)}},[]);const p=X.useMemo(()=>({email:[n,r],numberPeople:[a,i],isMobile:[s,o],isScrolled:[l,u],payDay:[c,h]}),[n,a,s,l,c]);return O.jsx(yi.Provider,{value:p,children:t})},Sz=X.memo(xz),uk="/assets/main_logo_cancilleria-BgARugpr.png",ck="/assets/instructivo_carta_identidad-zXBXsslt.pdf",mh="/assets/ejemplo_foto-Dl_ix33B.jpg",Tz={airtable:{base:"appXe9qo7ntzbEzgb",tabla:"carta_identidad"},nna:!0,dropbox:{folder:"carta_identidad"},files:[{title:"Foto fondo blanco",actionButton:"Subir foto",file:mh,accept:".jpg",name:"foto_solicitante"},{title:"Documento de identidad del solicitante (Cédula, Pasaporte o Acta de Nacimiento)",actionButton:"Subir documento",file:ck,accept:".jpg",name:"documento_identidad_solicitante"}],form:`

CARTA DE IDENTIDAD


La Embajada de la República Bolivariana de Venezuela en los Estados Unidos Mexicanos, Sección Consular, emite el presente documento al (la) ciudadano(a) {{primer_nombre}} {{segundo_nombre}} {{primer_apellido}} {{segundo_apellido}}, {{cedula}} {{pasaporte}} nacido(a) en {{estado_nacimiento}}, con fecha de nacimiento {{fecha_nacimiento}}, de {{edad}} años de edad, de estado civil {{estado_civil}}, y con los siguientes rasgos fisonómicos: rostro {{rostro}}, cabello de color {{pelo}} y ojos de color {{ojos}}.

Por medio de la presente hago constar su nacionalidad VENEZOLANA.

`,instructive:`

La carta de Identidad, es un documento con validez temporal que permite al o la solicitante, acceder a trámites y servicios en los que se requiera una identificación oficial.

El objetivo es proporcionar un documento oficial de identificación a un ciudadano de nacionalidad venezolana quien porta un documento de identificación (cedula de identidad y/o pasaporte) físico vencido, extraviado o deteriorado y se encuentre de tránsito en los Estados Unidos Mexicanos.

Requisitos Mayores de Edad:
- Pago del arancel consular de $60 USD.
- Llenar en línea la solicitud en: tramitesconsularesvenmex.com/carta-identidad
- Adjuntar foto personal (fondo blanco) en formato JPG (sin gorra, sin lentes, con cabello recogido)
- Adjuntar el documento de identidad que acredite la nacionalidad venezolana en formato JPG

Niño, Niña o Adolescente:
- Exento de pago.
- Llenar en línea la solicitud en: tramitesconsularesvenmex.com/carta-identidad
- Adjuntar foto personal (fondo blanco) en formato JPG (sin gorra, sin lentes, con cabello recogido)
- Adjuntar el documento de identidad que acredite la nacionalidad venezolana en formato JPG

Consideraciones importantes - Si el pago va a realizarlo en la sede de la Sección Consular de la Embajada de la República Bolivariana de Venezuela, este debe ser en efectivo en USD.
- Debe solicitar el código con el que podrá tener acceso a la forma (Adulto - Mayor de edad).
- Una vez llenado los datos, adjuntado los documentos solicitados y enviado la información deberá recibir la carta de identidad en el correo electrónico suministrado de 24 - 48 horas posteriores a su solicitud, en caso de encontrarse en la sede de la Embajada le será entregada el mismo día.

La Embajada no se hace responsable de ningún perjuicio económico, incluida la pérdida de pagos, en caso de que las autoridades migratorias detecten errores o datos incompletos en la solicitud. La veracidad de la información proporcionada es responsabilidad exclusiva del solicitante.

`,subtitle:"Carta de identidad",title:"Forma CI",values:[{placeholder:"Número de planilla de pago",type:"text",name:"numero_planilla",nna:"adult"},{placeholder:"Primer nombre",type:"text",name:"primer_nombre",nna:"both"},{placeholder:"Segundo nombre",type:"text",name:"segundo_nombre",apply:!0,nna:"both"},{placeholder:"Primer apellido",type:"text",name:"primer_apellido",nna:"both"},{placeholder:"Segundo apellido",type:"text",name:"segundo_apellido",apply:!0,nna:"both"},{placeholder:"Número de cédula - Ej.: 20400100",type:"text",name:"cedula",apply:!0,nna:"both"},{placeholder:"Número de pasaporte - Ej.: 123456789",type:"text",name:"pasaporte",apply:!0,nna:"both"},{placeholder:"Fecha de nacimiento",type:"date",name:"fecha_nacimiento",nna:"both"},{placeholder:"Estado de nacimiento",type:"text",name:"estado_nacimiento",select:[{label:"Seleccionar",value:""},{label:"Extranjero de Madre y/o Padre Venezolano",value:"Extranjero de Madre y/o Padre Venezolano"},{label:"Amazonas",value:"Amazonas"},{label:"Anzoátegui",value:"Anzoátegui"},{label:"Apure",value:"Apure"},{label:"Aragua",value:"Aragua"},{label:"Barinas",value:"Barinas"},{label:"Bolívar",value:"Bolívar"},{label:"Carabobo",value:"Carabobo"},{label:"Cojedes",value:"Cojedes"},{label:"Delta Amacuro",value:"Delta Amacuro"},{label:"Distrito Capital",value:"Distrito Capital"},{label:"Falcón",value:"Falcón"},{label:"Guárico",value:"Guárico"},{label:"Lara",value:"Lara"},{label:"La Guaira",value:"La Guaira"},{label:"Mérida",value:"Mérida"},{label:"Miranda",value:"Miranda"},{label:"Monagas",value:"Monagas"},{label:"Nueva Esparta",value:"Nueva Esparta"},{label:"Portuguesa",value:"Portuguesa"},{label:"Sucre",value:"Sucre"},{label:"Táchira",value:"Táchira"},{label:"Trujillo",value:"Trujillo"},{label:"Yaracuy",value:"Yaracuy"},{label:"Zulia",value:"Zulia"}],nna:"both"},{placeholder:"Ciudad de nacimiento",type:"text",name:"ciudad_nacimiento",select:[{estado:"Amazonas",ciudades:[{label:"Seleccionar",value:""},{label:"La Esmeralda (Alto Orinoco)",value:"La Esmeralda (Alto Orinoco)"},{label:"San Fernando de Atabapo (Atabapo)",value:"San Fernando de Atabapo (Atabapo)"},{label:"Puerto Ayacucho (Atures)",value:"Puerto Ayacucho (Atures)"},{label:"Isla Ratón (Autana)",value:"Isla Ratón (Autana)"},{label:"San Juan de Manapiare (Manapiare)",value:"San Juan de Manapiare (Manapiare)"},{label:"Maroa (Maroa)",value:"Maroa (Maroa)"},{label:"San Carlos de Río Negro (Río Negro)",value:"San Carlos de Río Negro (Río Negro)"}]},{estado:"Anzoátegui",ciudades:[{label:"Seleccionar",value:""},{label:"Anaco (Anaco)",value:"Anaco (Anaco)"},{label:"Aragua de Barcelona (Aragua)",value:"Aragua de Barcelona (Aragua)"},{label:"Barcelona (Bolívar)",value:"Barcelona (Bolívar)"},{label:"Clarines (Bruzual)",value:"Clarines (Bruzual)"},{label:"Onoto (Cajigal)",value:"Onoto (Cajigal)"},{label:"Valle de Guanape (Carvajal)",value:"Valle de Guanape (Carvajal)"},{label:"Cantaura (Freites)",value:"Cantaura (Freites)"},{label:"San José de Guanipa (Guanipa)",value:"San José de Guanipa (Guanipa)"},{label:"Guanta (Guanta)",value:"Guanta (Guanta)"},{label:"Soledad (Independencia)",value:"Soledad (Independencia)"},{label:"San Mateo (Libertad)",value:"San Mateo (Libertad)"},{label:"El Chaparro (Sir Arthur McGregor)",value:"El Chaparro (Sir Arthur McGregor)"},{label:"Pariaguán (Miranda)",value:"Pariaguán (Miranda)"},{label:"Mapire (Monagas)",value:"Mapire (Monagas)"},{label:"Puerto Píritu (Peñalver)",value:"Puerto Píritu (Peñalver)"},{label:"Píritu (Píritu)",value:"Píritu (Píritu)"},{label:"Boca de Uchire (San Juan de Capistrano)",value:"Boca de Uchire (San Juan de Capistrano)"},{label:"Santa Ana (Santa Ana)",value:"Santa Ana (Santa Ana)"},{label:"El Tigre (Simón Rodríguez)",value:"El Tigre (Simón Rodríguez)"},{label:"Puerto La Cruz (Sotillo)",value:"Puerto La Cruz (Sotillo)"},{label:"Lechería (Turístico Diego Bautista Urbaneja)",value:"Lechería (Turístico Diego Bautista Urbaneja)"}]},{estado:"Apure",ciudades:[{label:"Seleccionar",value:""},{label:"Achaguas (Achaguas)",value:"Achaguas (Achaguas)"},{label:"Biruaca (Biruaca)",value:"Biruaca (Biruaca)"},{label:"San Juan de Payara (Pedro Camejo)",value:"San Juan de Payara (Pedro Camejo)"},{label:"Bruzual (Muñoz)",value:"Bruzual (Muñoz)"},{label:"Guasdualito (Páez)",value:"Guasdualito (Páez)"},{label:"Elorza (Rómulo Gallegos)",value:"Elorza (Rómulo Gallegos)"},{label:"San Fernando de Apure (San Fernando)",value:"San Fernando de Apure (San Fernando)"}]},{estado:"Aragua",ciudades:[{label:"Seleccionar",value:""},{label:"Santa Rita (Alcántara)",value:"Santa Rita (Alcántara)"},{label:"San Mateo (Bolívar)",value:"San Mateo (Bolívar)"},{label:"Camatagua (Camatagua)",value:"Camatagua (Camatagua)"},{label:"Maracay (Girardot)",value:"Maracay (Girardot)"},{label:"El Limón (Iragorry)",value:"El Limón (Iragorry)"},{label:"Santa Cruz de Aragua (Lamas)",value:"Santa Cruz de Aragua (Lamas)"},{label:"Palo Negro (Libertador)",value:"Palo Negro (Libertador)"},{label:"Turmero (Mariño)",value:"Turmero (Mariño)"},{label:"Las Tejerías (Michelena)",value:"Las Tejerías (Michelena)"},{label:"Ocumare de la Costa (Ocumare de la Costa de Oro)",value:"Ocumare de la Costa (Ocumare de la Costa de Oro)"},{label:"El Consejo (Revenga)",value:"El Consejo (Revenga)"},{label:"La Victoria (Ribas)",value:"La Victoria (Ribas)"},{label:"San Casimiro (San Casimiro)",value:"San Casimiro (San Casimiro)"},{label:"San Sebastián de los Reyes (San Sebastián)",value:"San Sebastián de los Reyes (San Sebastián)"},{label:"Cagua (Sucre)",value:"Cagua (Sucre)"},{label:"Colonia Tovar (Tovar)",value:"Colonia Tovar (Tovar)"},{label:"Barbacoas (Urdaneta)",value:"Barbacoas (Urdaneta)"},{label:"Villa de Cura (Zamora)",value:"Villa de Cura (Zamora)"}]},{estado:"Barinas",ciudades:[{label:"Seleccionar",value:""},{label:"Sabaneta (Alberto Arvelo Torrealba)",value:"Sabaneta (Alberto Arvelo Torrealba)"},{label:"El Cantón (Andrés Eloy Blanco)",value:"El Cantón (Andrés Eloy Blanco)"},{label:"Socopó (Antonio José de Sucre)",value:"Socopó (Antonio José de Sucre)"},{label:"Arismendi (Arismendi)",value:"Arismendi (Arismendi)"},{label:"Barinas (Barinas)",value:"Barinas (Barinas)"},{label:"Barinitas (Bolívar)",value:"Barinitas (Bolívar)"},{label:"Barrancas (Cruz Paredes)",value:"Barrancas (Cruz Paredes)"},{label:"Santa Bárbara (Ezequiel Zamora)",value:"Santa Bárbara (Ezequiel Zamora)"},{label:"Obispos (Obispos)",value:"Obispos (Obispos)"},{label:"Ciudad Bolivia (Pedraza)",value:"Ciudad Bolivia (Pedraza)"},{label:"Libertad (Rojas)",value:"Libertad (Rojas)"},{label:"Ciudad de Nutrias (Sosa)",value:"Ciudad de Nutrias (Sosa)"}]},{estado:"Bolívar",ciudades:[{label:"Seleccionar",value:""},{label:"Ciudad Piar (Angostura)",value:"Ciudad Piar (Angostura)"},{label:"Ciudad Bolívar (Angostura del Orinoco)",value:"Ciudad Bolívar (Angostura del Orinoco)"},{label:"Ciudad Guayana (Caroní)",value:"Ciudad Guayana (Caroní)"},{label:"Caicara del Orinoco (Cedeño)",value:"Caicara del Orinoco (Cedeño)"},{label:"El Palmar (Chien)",value:"El Palmar (Chien)"},{label:"El Callao (El Callao)",value:"El Callao (El Callao)"},{label:"Santa Elena de Uairén (Gran Sabana)",value:"Santa Elena de Uairén (Gran Sabana)"},{label:"Upata (Piar)",value:"Upata (Piar)"},{label:"Guasipati (Roscio)",value:"Guasipati (Roscio)"},{label:"El Dorado (Sifontes)",value:"El Dorado (Sifontes)"},{label:"Maripa (Sucre)",value:"Maripa (Sucre)"}]},{estado:"Carabobo",ciudades:[{label:"Seleccionar",value:""},{label:"Bejuma (Bejuma)",value:"Bejuma (Bejuma)"},{label:"Güigüe (Carlos Arvelo)",value:"Güigüe (Carlos Arvelo)"},{label:"Mariara (Diego Ibarra)",value:"Mariara (Diego Ibarra)"},{label:"Guacara (Guacara)",value:"Guacara (Guacara)"},{label:"Morón (Juan José Mora)",value:"Morón (Juan José Mora)"},{label:"Tocuyito (Libertador)",value:"Tocuyito (Libertador)"},{label:"Los Guayos (Los Guayos)",value:"Los Guayos (Los Guayos)"},{label:"Miranda (Miranda)",value:"Miranda (Miranda)"},{label:"Montalbán (Montalbán)",value:"Montalbán (Montalbán)"},{label:"Naguanagua (Naguanagua)",value:"Naguanagua (Naguanagua)"},{label:"Puerto Cabello (Puerto Cabello)",value:"Puerto Cabello (Puerto Cabello)"},{label:"San Diego (San Diego)",value:"San Diego (San Diego)"},{label:"San Joaquín (San Joaquín)",value:"San Joaquín (San Joaquín)"},{label:"Valencia (Valencia)",value:"Valencia (Valencia)"}]},{estado:"Cojedes",ciudades:[{label:"Seleccionar",value:""},{label:"Cojedes (Anzoátegui)",value:"Cojedes (Anzoátegui)"},{label:"San Carlos (San Carlos)",value:"San Carlos (San Carlos)"},{label:"El Baúl (Girardot)",value:"El Baúl (Girardot)"},{label:"Macapo (Lima Blanco)",value:"Macapo (Lima Blanco)"},{label:"El Pao (Pao de San Juan Bautista)",value:"El Pao (Pao de San Juan Bautista)"},{label:"Libertad (Ricaurte)",value:"Libertad (Ricaurte)"},{label:"Las Vegas (Rómulo Gallegos)",value:"Las Vegas (Rómulo Gallegos)"},{label:"Tinaco (Tinaco)",value:"Tinaco (Tinaco)"},{label:"Tinaquillo (Tinaquillo)",value:"Tinaquillo (Tinaquillo)"}]},{estado:"Delta Amacuro",ciudades:[{label:"Seleccionar",value:""},{label:"Curiapo (Antonio Díaz)",value:"Curiapo (Antonio Díaz)"},{label:"Sierra Imataca (Casacoima)",value:"Sierra Imataca (Casacoima)"},{label:"Pedernales (Pedernales)",value:"Pedernales (Pedernales)"},{label:"Tucupita (Tucupita)",value:"Tucupita (Tucupita)"}]},{estado:"Distrito Capital",ciudades:[{label:"Seleccionar",value:""},{label:"Caracas (Libertador)",value:"Caracas (Libertador)"}]},{estado:"Falcón",ciudades:[{label:"Seleccionar",value:""},{label:"San Juan de los Cayos (Acosta)",value:"San Juan de los Cayos (Acosta)"},{label:"San Luis (Bolívar)",value:"San Luis (Bolívar)"},{label:"Capatárida (Buchivacoa)",value:"Capatárida (Buchivacoa)"},{label:"Punto Fijo (Carirubana)",value:"Punto Fijo (Carirubana)"},{label:"La Vela de Coro (Colina)",value:"La Vela de Coro (Colina)"},{label:"Dabajuro (Dabajuro)",value:"Dabajuro (Dabajuro)"},{label:"Pedregal (Democracia)",value:"Pedregal (Democracia)"},{label:"Pueblo Nuevo (Falcón)",value:"Pueblo Nuevo (Falcón)"},{label:"Churuguara (Federación)",value:"Churuguara (Federación)"},{label:"Chichiriviche (Iturriza)",value:"Chichiriviche (Iturriza)"},{label:"Jacura (Jacura)",value:"Jacura (Jacura)"},{label:"Santa Cruz de Los Taques (Los Taques)",value:"Santa Cruz de Los Taques (Los Taques)"},{label:"Yaracal (Manaure)",value:"Yaracal (Manaure)"},{label:"Mene de Mauroa (Mauroa)",value:"Mene de Mauroa (Mauroa)"},{label:"Santa Ana de Coro (Miranda)",value:"Santa Ana de Coro (Miranda)"},{label:"Palmasola (Palmasola)",value:"Palmasola (Palmasola)"},{label:"Cabure (Petit)",value:"Cabure (Petit)"},{label:"Píritu (Píritu)",value:"Píritu (Píritu)"},{label:"Mirimire (San Francisco)",value:"Mirimire (San Francisco)"},{label:"La Cruz de Taratara (Sucre)",value:"La Cruz de Taratara (Sucre)"},{label:"Tucacas (Silva)",value:"Tucacas (Silva)"},{label:"Tocópero (Tocópero)",value:"Tocópero (Tocópero)"},{label:"Santa Cruz de Bucaral (Unión)",value:"Santa Cruz de Bucaral (Unión)"},{label:"Urumaco (Urumaco)",value:"Urumaco (Urumaco)"},{label:"Puerto Cumarebo (Zamora)",value:"Puerto Cumarebo (Zamora)"}]},{estado:"Guárico",ciudades:[{label:"Seleccionar",value:""},{label:"Camaguán (Camaguán)",value:"Camaguán (Camaguán)"},{label:"Chaguaramas (Chaguaramas)",value:"Chaguaramas (Chaguaramas)"},{label:"El Socorro (El Socorro)",value:"El Socorro (El Socorro)"},{label:"Calabozo (Francisco de Miranda)",value:"Calabozo (Francisco de Miranda)"},{label:"Tucupido (José Félix Ribas)",value:"Tucupido (José Félix Ribas)"},{label:"Altagracia de Orituco (José Tadeo Monagas)",value:"Altagracia de Orituco (José Tadeo Monagas)"},{label:"San Juan de los Morros (Juan Germán Roscio)",value:"San Juan de los Morros (Juan Germán Roscio)"},{label:"Las Mercedes (Juan José Rondón)",value:"Las Mercedes (Juan José Rondón)"},{label:"El Sombrero (Julián Mellado)",value:"El Sombrero (Julián Mellado)"},{label:"Valle de La Pascua (Leonardo Infante)",value:"Valle de La Pascua (Leonardo Infante)"},{label:"Ortiz (Ortiz)",value:"Ortiz (Ortiz)"},{label:"Guayabal (San Gerónimo de Guayabal)",value:"Guayabal (San Gerónimo de Guayabal)"},{label:"San José de Guaribe (San José de Guaribe)",value:"San José de Guaribe (San José de Guaribe)"},{label:"Santa María de Ipire (Santa María de Ipire)",value:"Santa María de Ipire (Santa María de Ipire)"},{label:"Zaraza (Zaraza)",value:"Zaraza (Zaraza)"}]},{estado:"Lara",ciudades:[{label:"Seleccionar",value:""},{label:"Sanare (Andrés Eloy Blanco)",value:"Sanare (Andrés Eloy Blanco)"},{label:"Duaca (Crespo)",value:"Duaca (Crespo)"},{label:"Barquisimeto (Iribarren)",value:"Barquisimeto (Iribarren)"},{label:"Quibor (Jiménez)",value:"Quibor (Jiménez)"},{label:"El Tocuyo (Morán)",value:"El Tocuyo (Morán)"},{label:"Cabudare (Palavecino)",value:"Cabudare (Palavecino)"},{label:"Sarare (Simón Planas)",value:"Sarare (Simón Planas)"},{label:"Carora (Torres)",value:"Carora (Torres)"},{label:"Siquisique (Urdaneta)",value:"Siquisique (Urdaneta)"},{label:"La Guaira (Vargas)",value:"La Guaira (Vargas)"}]},{estado:"La Guaira",ciudades:[{label:"Seleccionar",value:""},{label:"La Guaira",value:"La Guaira"},{label:"Caraballeda",value:"Caraballeda"},{label:"Carayaca",value:"Carayaca"},{label:"Naiguatá",value:"Naiguatá"},{label:"Macuto",value:"Macuto"},{label:"Maiquetía",value:"Maiquetía"},{label:"Táriba",value:"Táriba"}]},{estado:"Mérida",ciudades:[{label:"Seleccionar",value:""},{label:"El Vigía (Alberto Adriani)",value:"El Vigía (Alberto Adriani)"},{label:"La Azulita (Andrés Bello)",value:"La Azulita (Andrés Bello)"},{label:"Santa Cruz de Mora (Antonio Pinto Salinas)",value:"Santa Cruz de Mora (Antonio Pinto Salinas)"},{label:"Aricagua (Aricagua)",value:"Aricagua (Aricagua)"},{label:"Canaguá (Arzobispo Chacón)",value:"Canaguá (Arzobispo Chacón)"},{label:"Ejido (Campo Elías)",value:"Ejido (Campo Elías)"},{label:"Tucaní (Caracciolo Parra Olmedo)",value:"Tucaní (Caracciolo Parra Olmedo)"},{label:"Santo Domingo (Cardenal Quintero)",value:"Santo Domingo (Cardenal Quintero)"},{label:"Guaraque (Guaraque)",value:"Guaraque (Guaraque)"},{label:"Arapuey (Julio Cesar Salas)",value:"Arapuey (Julio Cesar Salas)"},{label:"Torondoy (Justo Briceño)",value:"Torondoy (Justo Briceño)"},{label:"Mérida (Libertador)",value:"Mérida (Libertador)"},{label:"Timotes (Miranda)",value:"Timotes (Miranda)"},{label:"Santa Elena de Arenales (Obispo Ramos de Lora)",value:"Santa Elena de Arenales (Obispo Ramos de Lora)"},{label:"Santa María de Caparo (Padre Noguera)",value:"Santa María de Caparo (Padre Noguera)"},{label:"Pueblo Llano (Pueblo Llano)",value:"Pueblo Llano (Pueblo Llano)"},{label:"Mucuchíes (Rangel)",value:"Mucuchíes (Rangel)"},{label:"Bailadores (Rivas Dávila)",value:"Bailadores (Rivas Dávila)"},{label:"Tabay (Santos Marquina)",value:"Tabay (Santos Marquina)"},{label:"Lagunillas (Sucre)",value:"Lagunillas (Sucre)"},{label:"Tovar (Tovar)",value:"Tovar (Tovar)"},{label:"Nueva Bolivia (Tulio Febres Cordero)",value:"Nueva Bolivia (Tulio Febres Cordero)"},{label:"Zea (Zea)",value:"Zea (Zea)"}]},{estado:"Miranda",ciudades:[{label:"Seleccionar",value:""},{label:"Caucagua (Acevedo)",value:"Caucagua (Acevedo)"},{label:"San José de Barlovento (Andrés Bello)",value:"San José de Barlovento (Andrés Bello)"},{label:"Baruta (Baruta)",value:"Baruta (Baruta)"},{label:"San Francisco de Yare (Bolívar)",value:"San Francisco de Yare (Bolívar)"},{label:"Higuerote (Brión)",value:"Higuerote (Brión)"},{label:"Mamporal (Buroz)",value:"Mamporal (Buroz)"},{label:"Carrizal (Carrizal)",value:"Carrizal (Carrizal)"},{label:"Chacao (Chacao)",value:"Chacao (Chacao)"},{label:"Charallave (Cristóbal Rojas)",value:"Charallave (Cristóbal Rojas)"},{label:"El Hatillo (El Hatillo)",value:"El Hatillo (El Hatillo)"},{label:"Los Teques (Guaicaipuro)",value:"Los Teques (Guaicaipuro)"},{label:"El Jarillo (Guaicaipuro)",value:"El Jarillo (Guaicaipuro)"},{label:"Cúpira (Gual)",value:"Cúpira (Gual)"},{label:"Santa Teresa del Tuy (Independencia)",value:"Santa Teresa del Tuy (Independencia)"},{label:"Ocumare del Tuy (Lander)",value:"Ocumare del Tuy (Lander)"},{label:"San Antonio de los Altos (Los Salias)",value:"San Antonio de los Altos (Los Salias)"},{label:"Río Chico (Páez)",value:"Río Chico (Páez)"},{label:"Santa Lucía (Paz Castillo)",value:"Santa Lucía (Paz Castillo)"},{label:"Guarenas (Plaza)",value:"Guarenas (Plaza)"},{label:"Petare (Sucre)",value:"Petare (Sucre)"},{label:"Cúa (Urdaneta)",value:"Cúa (Urdaneta)"},{label:"Guatire (Zamora)",value:"Guatire (Zamora)"}]},{estado:"Monagas",ciudades:[{label:"Seleccionar",value:""},{label:"San Antonio de Capayacuar (Acosta)",value:"San Antonio de Capayacuar (Acosta)"},{label:"Aguasay (Aguasay)",value:"Aguasay (Aguasay)"},{label:"Caripito (Bolívar)",value:"Caripito (Bolívar)"},{label:"Caripe (Caripe)",value:"Caripe (Caripe)"},{label:"Caicara de Maturín (Cedeño)",value:"Caicara de Maturín (Cedeño)"},{label:"Temblador (Libertador)",value:"Temblador (Libertador)"},{label:"Maturín (Maturín)",value:"Maturín (Maturín)"},{label:"Aragua de Maturín (Piar)",value:"Aragua de Maturín (Piar)"},{label:"Quiriquire (Punceres)",value:"Quiriquire (Punceres)"},{label:"Santa Bárbara (Santa Bárbara)",value:"Santa Bárbara (Santa Bárbara)"},{label:"Barrancas del Orinoco (Sotillo)",value:"Barrancas del Orinoco (Sotillo)"},{label:"Uracoa (Uracoa)",value:"Uracoa (Uracoa)"},{label:"Punta de Mata (Zamora)",value:"Punta de Mata (Zamora)"}]},{estado:"Nueva Esparta",ciudades:[{label:"Seleccionar",value:""},{label:"La Plaza de Paraguachí (Antolín del Campo)",value:"La Plaza de Paraguachí (Antolín del Campo)"},{label:"San Juan Bautista (Antonio Díaz)",value:"San Juan Bautista (Antonio Díaz)"},{label:"La Asunción (Arismendi)",value:"La Asunción (Arismendi)"},{label:"El Valle (García)",value:"El Valle (García)"},{label:"Santa Ana (Gómez)",value:"Santa Ana (Gómez)"},{label:"Boca de Río (Macanao)",value:"Boca de Río (Macanao)"},{label:"Pampatar (Maneiro)",value:"Pampatar (Maneiro)"},{label:"Juan Griego (Marcano)",value:"Juan Griego (Marcano)"},{label:"Porlamar (Mariño)",value:"Porlamar (Mariño)"},{label:"Punta de Piedras (Tubores)",value:"Punta de Piedras (Tubores)"},{label:"San Pedro de Coche (Villalba)",value:"San Pedro de Coche (Villalba)"}]},{estado:"Portuguesa",ciudades:[{label:"Seleccionar",value:""},{label:"Agua Blanca (Agua Blanca)",value:"Agua Blanca (Agua Blanca)"},{label:"Araure (Araure)",value:"Araure (Araure)"},{label:"Píritu (Esteller)",value:"Píritu (Esteller)"},{label:"Guanare (Guanare)",value:"Guanare (Guanare)"},{label:"Guanarito (Guanarito)",value:"Guanarito (Guanarito)"},{label:"Chabasquén (José Vicente de Unda)",value:"Chabasquén (José Vicente de Unda)"},{label:"Ospino (Ospino)",value:"Ospino (Ospino)"},{label:"Acarigua (Páez)",value:"Acarigua (Páez)"},{label:"Papelón (Papelón)",value:"Papelón (Papelón)"},{label:"Boconoíto (San Genaro de Boconoíto)",value:"Boconoíto (San Genaro de Boconoíto)"},{label:"San Rafael de Onoto (San Rafael de Onoto)",value:"San Rafael de Onoto (San Rafael de Onoto)"},{label:"El Playón (Santa Rosalía)",value:"El Playón (Santa Rosalía)"},{label:"Biscucuy (Sucre)",value:"Biscucuy (Sucre)"},{label:"Villa Bruzual (Turén)",value:"Villa Bruzual (Turén)"}]},{estado:"Sucre",ciudades:[{label:"Seleccionar",value:""},{label:"Casanay (Andrés Eloy Blanco)",value:"Casanay (Andrés Eloy Blanco)"},{label:"San José de Aerocuar (Andrés Mata)",value:"San José de Aerocuar (Andrés Mata)"},{label:"Río Caribe (Arismendi)",value:"Río Caribe (Arismendi)"},{label:"El Pilar (Benítez)",value:"El Pilar (Benítez)"},{label:"Carúpano (Bermúdez)",value:"Carúpano (Bermúdez)"},{label:"Marigüitar (Bolívar)",value:"Marigüitar (Bolívar)"},{label:"Yaguaraparo (Cajigal)",value:"Yaguaraparo (Cajigal)"},{label:"Araya (Cruz Salmerón Acosta)",value:"Araya (Cruz Salmerón Acosta)"},{label:"Tunapuy (Libertador)",value:"Tunapuy (Libertador)"},{label:"Irapa (Mariño)",value:"Irapa (Mariño)"},{label:"San Antonio del Golfo (Mejía)",value:"San Antonio del Golfo (Mejía)"},{label:"Cumanacoa (Montes)",value:"Cumanacoa (Montes)"},{label:"Cariaco (Ribero)",value:"Cariaco (Ribero)"},{label:"Cumaná (Sucre)",value:"Cumaná (Sucre)"},{label:"Güiria (Valdez)",value:"Güiria (Valdez)"}]},{estado:"Táchira",ciudades:[{label:"Seleccionar",value:""},{label:"Cordero (Andrés Bello)",value:"Cordero (Andrés Bello)"},{label:"Las Mesas (Antonio Rómulo Costa)",value:"Las Mesas (Antonio Rómulo Costa)"},{label:"Colón (Ayacucho)",value:"Colón (Ayacucho)"},{label:"San Antonio del Táchira (Bolívar)",value:"San Antonio del Táchira (Bolívar)"},{label:"Táriba (Cárdenas)",value:"Táriba (Cárdenas)"},{label:"Santa Ana de Táchira (Córdoba)",value:"Santa Ana de Táchira (Córdoba)"},{label:"San Rafael del Piñal (Fernández)",value:"San Rafael del Piñal (Fernández)"},{label:"San José de Bolívar (Francisco de Miranda)",value:"San José de Bolívar (Francisco de Miranda)"},{label:"La Fría (García de Hevia)",value:"La Fría (García de Hevia)"},{label:"Palmira (Guásimos)",value:"Palmira (Guásimos)"},{label:"Capacho Nuevo (Independencia)",value:"Capacho Nuevo (Independencia)"},{label:"La Grita (Jáuregui)",value:"La Grita (Jáuregui)"},{label:"El Cobre (José María Vargas)",value:"El Cobre (José María Vargas)"},{label:"Rubio (Junín)",value:"Rubio (Junín)"},{label:"Capacho Viejo (Libertad)",value:"Capacho Viejo (Libertad)"},{label:"Abejales (Libertador)",value:"Abejales (Libertador)"},{label:"Lobatera (Lobatera)",value:"Lobatera (Lobatera)"},{label:"Michelena (Michelena)",value:"Michelena (Michelena)"},{label:"Coloncito (Panamericano)",value:"Coloncito (Panamericano)"},{label:"Ureña (Pedro María Ureña)",value:"Ureña (Pedro María Ureña)"},{label:"Delicias (Rafael Urdaneta)",value:"Delicias (Rafael Urdaneta)"},{label:"La Tendida (Samuel Dario Maldonado)",value:"La Tendida (Samuel Dario Maldonado)"},{label:"San Cristóbal (San Cristóbal)",value:"San Cristóbal (San Cristóbal)"},{label:"Umuquena (San Judas Tadeo)",value:"Umuquena (San Judas Tadeo)"},{label:"Seboruco (Seboruco)",value:"Seboruco (Seboruco)"},{label:"San Simón (Simón Rodríguez)",value:"San Simón (Simón Rodríguez)"},{label:"Queniquea (Sucre)",value:"Queniquea (Sucre)"},{label:"San Josecito (Torbes)",value:"San Josecito (Torbes)"},{label:"Pregonero (Uribante)",value:"Pregonero (Uribante)"}]},{estado:"Trujillo",ciudades:[{label:"Seleccionar",value:""},{label:"Santa Isabel (Andrés Bello)",value:"Santa Isabel (Andrés Bello)"},{label:"Boconó (Boconó)",value:"Boconó (Boconó)"},{label:"Sabana Grande (Bolívar)",value:"Sabana Grande (Bolívar)"},{label:"Chejendé (Candelaria)",value:"Chejendé (Candelaria)"},{label:"Carache (Carache)",value:"Carache (Carache)"},{label:"Carvajal (Carvajal)",value:"Carvajal (Carvajal)"},{label:"Escuque (Escuque)",value:"Escuque (Escuque)"},{label:"Campo Elías (Juan Vicente Campo Elías)",value:"Campo Elías (Juan Vicente Campo Elías)"},{label:"Santa Apolonia (La Ceiba)",value:"Santa Apolonia (La Ceiba)"},{label:"El Paradero (Márquez Cañizales)",value:"El Paradero (Márquez Cañizales)"},{label:"El Dividive (Miranda)",value:"El Dividive (Miranda)"},{label:"Monte Carmelo (Monte Carmelo)",value:"Monte Carmelo (Monte Carmelo)"},{label:"Motatán (Motatán)",value:"Motatán (Motatán)"},{label:"Pampán (Pampán)",value:"Pampán (Pampán)"},{label:"Pampanito (Pampanito)",value:"Pampanito (Pampanito)"},{label:"Betijoque (Rangel)",value:"Betijoque (Rangel)"},{label:"Sabana de Mendoza (Sucre)",value:"Sabana de Mendoza (Sucre)"},{label:"Trujillo (Trujillo)",value:"Trujillo (Trujillo)"},{label:"La Quebrada (Urdaneta)",value:"La Quebrada (Urdaneta)"},{label:"Valera (Valera)",value:"Valera (Valera)"}]},{estado:"Yaracuy",ciudades:[{label:"Seleccionar",value:""},{label:"San Pablo (Arístides Bastidas)",value:"San Pablo (Arístides Bastidas)"},{label:"Aroa (Bolívar)",value:"Aroa (Bolívar)"},{label:"Chivacoa (Bruzual)",value:"Chivacoa (Bruzual)"},{label:"Cocorote (Cocorote)",value:"Cocorote (Cocorote)"},{label:"Independencia (Independencia)",value:"Independencia (Independencia)"},{label:"Sabana de Parra (José Antonio Páez)",value:"Sabana de Parra (José Antonio Páez)"},{label:"Boraure (La Trinidad)",value:"Boraure (La Trinidad)"},{label:"Yumare (Manuel Monge)",value:"Yumare (Manuel Monge)"},{label:"Nirgua (Nirgua)",value:"Nirgua (Nirgua)"},{label:"Yaritagua (Peña)",value:"Yaritagua (Peña)"},{label:"San Felipe (San Felipe)",value:"San Felipe (San Felipe)"},{label:"Guama (Sucre)",value:"Guama (Sucre)"},{label:"Urachiche (Urachiche)",value:"Urachiche (Urachiche)"},{label:"Farriar (Veroes)",value:"Farriar (Veroes)"}]},{estado:"Zulia",ciudades:[{label:"Seleccionar",value:""},{label:"El Toro (Almirante Padilla)",value:"El Toro (Almirante Padilla)"},{label:"San Timoteo (Baralt)",value:"San Timoteo (Baralt)"},{label:"Cabimas (Cabimas)",value:"Cabimas (Cabimas)"},{label:"Encontrados (Catatumbo)",value:"Encontrados (Catatumbo)"},{label:"San Carlos del Zulia (Colón)",value:"San Carlos del Zulia (Colón)"},{label:"Pueblo Nuevo-El Chivo (Francisco Javier Pulgar)",value:"Pueblo Nuevo-El Chivo (Francisco Javier Pulgar)"},{label:"Sinamaica (Guajira)",value:"Sinamaica (Guajira)"},{label:"La Concepción (Jesús Enrique Lossada)",value:"La Concepción (Jesús Enrique Lossada)"},{label:"Casigua El Cubo (Jesús María Semprún)",value:"Casigua El Cubo (Jesús María Semprún)"},{label:"Concepción (La Cañada de Urdaneta)",value:"Concepción (La Cañada de Urdaneta)"},{label:"Ciudad Ojeda (Lagunillas)",value:"Ciudad Ojeda (Lagunillas)"},{label:"Machiques (Machiques de Perijá)",value:"Machiques (Machiques de Perijá)"},{label:"San Rafael del Moján (Mara)",value:"San Rafael del Moján (Mara)"},{label:"Maracaibo (Maracaibo)",value:"Maracaibo (Maracaibo)"},{label:"Los Puertos de Altagracia (Miranda)",value:"Los Puertos de Altagracia (Miranda)"},{label:"La Villa del Rosario (Rosario de Perijá)",value:"La Villa del Rosario (Rosario de Perijá)"},{label:"San Francisco (San Francisco)",value:"San Francisco (San Francisco)"},{label:"Santa Rita (Santa Rita)",value:"Santa Rita (Santa Rita)"},{label:"Tía Juana (Simón Bolívar)",value:"Tía Juana (Simón Bolívar)"},{label:"Bobures (Sucre)",value:"Bobures (Sucre)"},{label:"Bachaquero (Valmore Rodríguez)",value:"Bachaquero (Valmore Rodríguez)"}]}],nna:"both"},{placeholder:"Sexo",type:"text",name:"sexo",select:[{label:"Seleccionar",value:""},{label:"Masculino",value:"Masculino"},{label:"Femenino",value:"Femenino"}],nna:"both"},{placeholder:"Estado civil",type:"text",name:"estado_civil",select:[{label:"Seleccionar",value:""},{label:"Soltero(a)",value:"Soltero(a)"},{label:"Casado(a)",value:"Casado(a)"},{label:"Divorciado(a)",value:"Divorciado(a)"},{label:"Viudo(a)",value:"Viudo(a)"}],nna:"both"},{placeholder:"Nivel de educación",type:"text",name:"nivel_educativo",select:[{label:"Seleccionar",value:""},{label:"No escolarizado",value:"No escolarizado"},{label:"Educación Básica",value:"Educación Básica"},{label:"Bachiller",value:"Bachiller"},{label:"Universitario",value:"Universitario"}],nna:"both"},{placeholder:"Profesión u Ocupación",type:"text",name:"profesion_ocupacion",nna:"adult"},{placeholder:"Teléfono celular - Ej.: +52 5561644490",type:"text",name:"celular",nna:"adult",apply:!0},{placeholder:"Correo electrónico - Ej.: tucorreo@embajada.com",type:"email",name:"email",nna:"both"},{placeholder:"Teléfono de emergencia. - Ej.: +52 5561644490",type:"text",name:"telefono_emergencia",nna:"both"},{placeholder:"Nombre completo del Papá",type:"text",name:"nombre_padre",nna:"nna"},{placeholder:"Nombre completo de la Mamá",type:"text",name:"nombre_madre",nna:"nna"},{placeholder:"Caracteristicas del rostro",type:"text",name:"rostro",select:[{label:"Seleccionar",value:""},{label:"Ovalado",value:"Ovalado"},{label:"Redondo",value:"Redondo"},{label:"Cuadrado",value:"Cuadrado"}],nna:"both"},{placeholder:"Color de ojos",type:"text",name:"ojos",select:[{label:"Seleccionar",value:""},{label:"Negro",value:"Negro"},{label:"Marrón",value:"Marrón"},{label:"Verde",value:"Verde"},{label:"Azul",value:"Azul"},{label:"Gris",value:"Gris"},{label:"Amarillo",value:"Amarillo"}],nna:"both"},{placeholder:"Color de cabello",type:"text",name:"pelo",select:[{label:"Seleccionar",value:""},{label:"Negro",value:"Negro"},{label:"Marrón",value:"Marrón"},{label:"Gris",value:"Gris"},{label:"Blanco",value:"Blanco"},{label:"Azul",value:"Azul"},{label:"Verde",value:"Verde"},{label:"Amarillo",value:"Amarillo"},{label:"Rojizo",value:"Rojizo"},{label:"Calvo",value:"Calvo"}],nna:"both"},{placeholder:"Puerto de entrada CBP",type:"text",name:"puerto_entrada_cbp",select:[{label:"Seleccionar",value:""},{label:"Nogales",value:"Nogales"},{label:"Sasabe",value:"Sasabe"},{label:"Calexico",value:"Calexico"},{label:"San Ysidro",value:"San Ysidro"},{label:"Tecate",value:"Tecate"},{label:"Brownsville",value:"Brownsville"},{label:"Eagle Pass",value:"Eagle Pass"},{label:"Hidalgo",value:"Hidalgo"},{label:"Laredo",value:"Laredo"},{label:"El Paso",value:"El Paso"}],nna:"both",apply:!0},{placeholder:"Fecha de cita CBP",type:"date",name:"fecha_cita_cbp",nna:"both",apply:!0},{placeholder:"Documento de identificación presentado (En subir documento)",type:"text",name:"documento_identificación_presentado",select:[{label:"Seleccionar",value:""},{label:"Cédula de identidad",value:"Cédula de identidad"},{label:"Pasaporte",value:"Pasaporte"},{label:"Acta de nacimiento",value:"Acta de nacimiento"}],nna:"both"}]},wz="/assets/passport_example-D52uoKEj.png",Cz="/assets/cita_saime_example-CrqDWyQ3.png",Az="/assets/airplane_ticket-DJFEgm1s.png",Iz="/assets/manual_pdf-Dy5YfO9r.pdf",Pz={airtable:{base:"app8bLzmgO7UcZF1h",tabla:"cita_saime"},codeNeed:!1,dropbox:{folder:"cita_saime"},files:[{title:"Foto fondo blanco",actionButton:"Subir imagen",file:mh,accept:".jpg",name:"foto"},{title:"Documento PDF del solicitante",actionButton:"Subir PDF",file:Iz,accept:".pdf",name:"pdf"}],form:`

CONSTANCIA DE CITA SAIME


La Embajada de la República Bolivariana de Venezuela en los Estados Unidos Mexicanos hace constar, por medio de la presente, que el (la) ciudadano(a) {{primer_nombre}} {{segundo_nombre}} {{primer_apellido}} {{segundo_apellido}}, {{cedula}} {{numero_pasaporte_vencido}} con fecha de nacimiento {{fecha_nacimiento}}, de estado civil: {{estado_civil}}, con profesión/ocupación: {{profesion_ocupacion}} y residenciado(a) en {{ciudad_residencia}}, {{estado_residencia}}, {{pais_residencia}}, requiere asistir a la sede de la sección consular de esta Misión Diplomática, ubicada en la Ciudad de México, para realizar el trámite relacionado con la Renovación de su Pasaporte Biométrico, teniendo su cita programada para el día {{fecha_de_cita}}.

Por este motivo, solicitamos a las autoridades del Instituto Nacional de Migración (INM) autorice la entrada y salida de territorio mexicano al mencionado(a) ciudadano(a), quien retornará a su lugar de origen una vez concluido su trámite, cumpliendo el siguiente itinerario:

Ingresando a México el día {{fecha_viaje_ida}}, en el(los) vuelo(s): {{numero_vuelo_ida}} de la(s) aerolínea(s): {{aerolineas_ida}} con ruta: {{ruta_viaje_ida}}.

Regresando de México a su ciudad de origen el día {{fecha_viaje_retorno}} en el(los) vuelo(s): {{numero_vuelo_retorno}} de la(s) aerolínea(s): {{aerolinea_retorno}} siguiendo la ruta: {{ruta_viaje_retorno}}.

`,instructive:`

El presente instructivo presenta las instrucciones para requerir el documento de viaje constancia de cita SAIME, a objeto que pueda asistir a la cita de pasaporte agendada en el sistema SAIME.

Esta solo es requerida para ingresar al territorio de los Estados Unidos Mexicanos en caso de que su documento de viaje (pasaporte) no se encuentre vigente.

La constancia de cita SAIME solo es aplicable a los ingresos vía aérea por el Aeropuerto Internacional Benito Juárez y el Aeropuerto Internacional Felipe Ángeles que sirven a la Ciudad de México.

Ante todo, debe tener presente que la constancia de cita SAIME solo puede otorgarse a connacionales que tengan residencia en Estados Unidos de América o Canadá.

Si no cumple las condiciones anteriores debe consultar con el personal de nuestra embajada que apoyo se le puede prestar.

Requisitos Un (1) Archivo PDF
Los recaudos necesarios deberán ser enviados en formato digital, escaneados y guardados en PDF, en un solo documento por persona y/o documentos separados por cada persona que solicita constancia de cita SAIME, en formato PDF.

El solicitante deberá enviar por cada solicitud el archivo PDF con los siguiente documentos:
- Planilla de la asignación de la cita SAIME (2 páginas).
- Copia del pasaporte vencido y prórroga en caso de que aplique.
- Copia del boleto aéreo: antes de solicitar boleto aéreo verificar con la aerolínea de su preferencia, si permite el abordaje con la constancia de cita SAIME.
- Tarjeta de residencia permanente, visa americana o mexicana vigente, green card y/o TPS (I-512T). Connacionales que poseen pasaporte de otra nacionalidad, no requiere de la constancia para asistir a la captura de huellas y datos para renovación de pasaporte.
- En el caso de menores de edad, acta de nacimiento.


Un (1) archivo JPG
Adjuntar foto personal (fondo blanco) en formato JPG (sin gorra, sin lentes, con cabello recogido)

Forma Web - Debe llenar la información correspondiente a cada persona que solicita la constancia cita SAIME.
- Se registra y envía persona a persona.

Ejemplo de llenado
a. En el formulario web la información para el llenado de los renglones de datos personales debe ser tomada de los datos del pasaporte:
1. Primer Nombre
2. Segundo Nombre
3. Primer Apellido
4. Segundo Apellido
5. Fecha de Nacimiento.
6. Número de pasaporte (vencido) con el que viajará, este número se encuentra en la parte superior derecha.
7. Cédula de Identidad

Esta información se debe tomar de la primera página del pasaporte:

b. La información sobre los datos de residencia:
- Estado de residencia: es el estado donde vive.
- Ciudad de residencia: es en la ciudad que vive.
- País de residencia: es el país donde vive.

c. Renglón fecha de la cita:
Se debe tomar de planilla SAIME.

d. Del renglón sobre los datos del viaje:
Datos del viaje de salida hacia Ciudad de México:
- Fecha de viaje: Día en que será su salida hacia la Ciudad de México.
- Ruta de viaje: Es del país de origen, nombrando si hacen escalas hasta la Ciudad de México:
Ejemplo 1: MIA / MEX
Ejemplo 2: DAL / MCO / MEX
- Número(s) de vuelo(s): La nomenclatura utilizada por las aerolíneas, son campos alfanuméricos:
- American Airlines: AA XXXX (AA505)
- Aeroméxico: AMXXXX (AM441)
- Delta Airlines: DLXXXX (DL662)
- Volaris: Y4XXXX (Y4875)
- Viva Aerobus: VBXXX (VB152)
En caso de hacer escala, se debe colocar una barra (/) para separar números de vuelos.
Ejemplo: AA505 / AM402.
- Aerolínea: Es la aerolínea de su preferencia, debe colocar el nombre completo de la misma.
Ejemplo de boleto aéreo de salida:

Datos del viaje de retorno hacia Ciudad de Destino:
- Fecha de viaje: Día en que regresa a su ciudad de residencia.
- Ruta de viaje: Desde la Ciudad de México hacia su ciudad de retorno:
Ejemplo 1: MEX / MIA
Ejemplo 2: MEX / MIA / MCO
- Aerolínea: Es la aerolínea de su preferencia, debe colocar el nombre completo de la misma, en caso de ser varias debe colocar una barra (/)
Ejemplo: American Airlines / Volaris

e. Renglón de profesión u ocupación:
Colocar el título o la actividad que desempeña.

f. Estado civil:
Seleccione su estado civil en la actualidad no considere el de la cédula de identidad.

g. Número de teléfono:
Debe ser un número de teléfono que tenga Whatsapp y que pueda recibir llamadas.

h. Correo electrónico:
Es el correo donde va a recibir la Constancia de Cita SAIME.

Consideraciones importantes - Si su documento y/o foto no es cargado según lo establecido en las instrucciones su documento de viaje no podrá emitirse, para generar uno nuevo debe comunicarse con el personal de nuestra embajada.
- Únicamente aplica para venezolanos con residencia en el país de origen, visa americana o mexicana vigente, green card y/o TPS (I-512T).
- El documento solo es emitido para viajes de 5 días.

Le recordamos que el sistema es autogestionado, por lo que debe prestar especial atención a cada dato ingresado en el formulario, ya que cualquier error se reflejará en la constancia emitida.

La Embajada no se hace responsable de ningún perjuicio económico, incluida la pérdida de pagos, en caso de que las autoridades migratorias detecten errores o datos incompletos en la solicitud. La veracidad de la información proporcionada es responsabilidad exclusiva del solicitante.

`,subtitle:"Constancia cita SAIME",title:"Forma CCS",values:[{placeholder:"Primer Nombre",type:"text",name:"primer_nombre"},{placeholder:"Segundo Nombre",type:"text",name:"segundo_nombre",apply:!0},{placeholder:"Primer Apellido",type:"text",name:"primer_apellido"},{placeholder:"Segundo Apellido",type:"text",name:"segundo_apellido",apply:!0},{placeholder:"Número de cédula. Ej.: 20440100",type:"text",name:"cedula",apply:!0},{placeholder:"Número de pasaporte vencido Ej.: 123456789",type:"text",name:"numero_pasaporte_vencido"},{placeholder:"Fecha de Nacimiento",type:"date",name:"fecha_nacimiento"},{placeholder:"Sexo",type:"text",name:"sexo",select:[{label:"Seleccionar",value:""},{label:"Masculino",value:"Masculino"},{label:"Femenino",value:"Femenino"}]},{placeholder:"Estado civil",type:"text",name:"estado_civil",select:[{label:"Seleccionar",value:""},{label:"Soltero(a)",value:"Soltero(a)"},{label:"Casado(a)",value:"Casado(a)"},{label:"Divorciado(a)",value:"Divorciado(a)"},{label:"Viudo(a)",value:"Viudo(a)"}]},{placeholder:"Profesión u ocupación",type:"text",name:"profesion_ocupacion"},{placeholder:"País de residencia",type:"text",name:"pais_residencia",select:[{label:"Seleccionar",value:""},{label:"México",value:"Estados Unidos Mexicanos"},{label:"Argentina",value:"Argentina"},{label:"Canadá",value:"Canadá"},{label:"Chile",value:"Chile"},{label:"Costa Rica",value:"Costa Rica"},{label:"Ecuador",value:"Ecuador"},{label:"El Salvador",value:"El Salvador"},{label:"Estados Unidos de América",value:"Estados Unidos de América"},{label:"Guatemala",value:"Guatemala"},{label:"Honduras",value:"Honduras"},{label:"Jamaica",value:"Jamaica"},{label:"Panamá",value:"Panamá"},{label:"Perú",value:"Perú"},{label:"República Dominicana",value:"República Dominicana"},{label:"Uruguay",value:"Uruguay"}]},{placeholder:"Estado de residencia - Ej.: Florida",type:"text",name:"estado_residencia"},{placeholder:"Ciudad de residencia - Ej.: Miami",type:"text",name:"ciudad_residencia"},{placeholder:"Fecha de cita",type:"date",name:"fecha_de_cita"},{placeholder:"Fecha de viaje (INGRESO)",type:"date",name:"fecha_viaje_ida"},{placeholder:"Ruta de viaje (INGRESO), en código IATA. Ej.: MIA / MEX (Si tiene escala MIA / GDL / MEX)",type:"text",name:"ruta_viaje_ida"},{placeholder:"Aerolíneas (INGRESO) - Ej.: Viva Aerobus (Si tiene varias lineas aereas Viva Aerobus / Aeromexico)",type:"text",name:"aerolineas_ida"},{placeholder:"Números de vuelos (INGRESO) - Ej.: VB152 (Si tiene varios numeros de vuelo VB152 / VB153)",type:"text",name:"numero_vuelo_ida"},{placeholder:"Fecha de viaje (RETORNO)",type:"date",name:"fecha_viaje_retorno"},{placeholder:"Ruta de viaje (RETORNO), en código IATA. Ej.: MEX / MIA (Si tiene escala MEX / GDL / MIA)",type:"text",name:"ruta_viaje_retorno"},{placeholder:"Aerolíneas (RETORNO) - Ej.: Aeromexico (Si tiene varias lineas aereas Aeromexico / Viva Aerobus)",type:"text",name:"aerolinea_retorno"},{placeholder:"Números de vuelos (RETORNO) - Ej.: VB153 (Si tiene varios numeros de vuelo VB153 / VB152)",type:"text",name:"numero_vuelo_retorno"},{placeholder:"Teléfono - Ej.: +1 7869656708",type:"text",name:"telefono"},{placeholder:"Correo electrónico - Ej.: tucorreo@embajada.com",type:"email",name:"correo_electronico"}]},Rz="/assets/manual_pdf_fe_vida-6nK7Nfmu.pdf",kz={airtable:{base:"appinv99a5JZOOLav",tabla:"fe_vida"},nna:!1,codeNeed:!1,dropbox:{folder:"fe_vida"},files:[{title:"Foto fondo blanco",actionButton:"Subir imagen",file:mh,accept:".jpg",name:"foto"},{title:"Documento PDF del solicitante",actionButton:"Subir PDF",file:Rz,accept:".pdf",name:"pdf"}],form:`

FE DE VIDA


Yo, FRANCISCO JAVIER ARIAS CARDENAS, actuando en mi carácter de Embajador de la Embajada de la República Bolivariana de Venezuela en los Estados Unidos Mexicanos, según resolución DM N° 087, publicada en Gaceta Oficial N° 41.609, de fecha tres de abril de dos mil diecinueve, del Ministerio del Poder Popular para las Relaciones Exteriores, hago constar que el(la) ciudadano(a) {{primer_nombre}} {{segundo_nombre}} {{primer_apellido}} {{segundo_apellido}}, {{cedula}} {{pasaporte}} se encuentra con VIDA y está domiciliado(a) en {{pais_residencia_ultimos_dias}} en: {{address}}, {{pais_residencia_ultimos_dias}}.

`,instructive:`

La Fe de Vida es un documento oficial que certifica la existencia en vida de un ciudadano(a) y puede ser requerido para diversos trámites legales o administrativos, tanto dentro como fuera de la República Bolivariana de Venezuela. Este documento es especialmente útil para venezolanos en el extranjero que necesitan validar su estado civil y su existencia ante instituciones nacionales o internacionales.

El propósito principal de la Fe de Vida es proporcionar una constancia oficial de la existencia en vida del ciudadano(a) venezolano, especialmente en casos donde se requiera demostrar su vigencia ante organismos públicos o privados, como embajadas, consulados, bancos, o instituciones de seguridad social.

Requisitos - Exento de pago.
- Llenar en línea la solicitud en: tramitesconsularesvenmex.com/fe-vida
- Adjuntar foto personal (fondo blanco) en formato JPG (sin gorra, sin lentes, con cabello recogido)
- Adjuntar un documento en formato PDF que incluya los siguientes elementos: cédula de identidad venezolana, pasaporte venezolano, recibo de servicio y carta expositiva de solicitud

Consideraciones importantes - Una vez llenado los datos, adjuntado los documentos solicitados y enviado la información deberá recibir la carta de identidad en el correo electrónico suministrado de 24 - 48 horas posteriores a su solicitud, en caso de encontrarse en la sede de la Embajada le será entregada el mismo día.

La Embajada no se hace responsable de ningún perjuicio económico, incluida la pérdida de pagos. La veracidad de la información proporcionada es responsabilidad exclusiva del solicitante.

`,subtitle:"Fe de vida",title:"Forma FDV",values:[{placeholder:"País de residencia en los últimos 30 días",type:"text",name:"pais_residencia_ultimos_dias",select:[{label:"Seleccionar",value:""},{label:"México",value:"Estados Unidos Mexicanos"},{label:"Argentina",value:"Argentina"},{label:"Canadá",value:"Canadá"},{label:"Chile",value:"Chile"},{label:"Costa Rica",value:"Costa Rica"},{label:"Ecuador",value:"Ecuador"},{label:"El Salvador",value:"El Salvador"},{label:"Estados Unidos de América",value:"Estados Unidos de América"},{label:"Guatemala",value:"Guatemala"},{label:"Honduras",value:"Honduras"},{label:"Jamaica",value:"Jamaica"},{label:"Panamá",value:"Panamá"},{label:"Perú",value:"Perú"},{label:"República Dominicana",value:"República Dominicana"},{label:"Uruguay",value:"Uruguay"}],nna:"both"},{placeholder:"Primer Nombre",type:"text",name:"primer_nombre",nna:"both"},{placeholder:"Segundo Nombre",type:"text",name:"segundo_nombre",apply:!0,nna:"both"},{placeholder:"Primer Apellido",type:"text",name:"primer_apellido",nna:"both"},{placeholder:"Segundo Apellido",type:"text",name:"segundo_apellido",apply:!0,nna:"both"},{placeholder:"Número de cédula. Ej.: 20440100",type:"text",name:"cedula",nna:"both"},{placeholder:"Número de pasaporte Ej.: 123456789",type:"text",name:"pasaporte",apply:!0,nna:"both"},{placeholder:"Fecha de Nacimiento",type:"date",name:"fecha_nacimiento",nna:"both"},{placeholder:"Estado de nacimiento",type:"text",name:"estado_nacimiento",select:[{label:"Seleccionar",value:""},{label:"Extranjero de Madre y/o Padre Venezolano",value:"Extranjero de Madre y/o Padre Venezolano"},{label:"Amazonas",value:"Amazonas"},{label:"Anzoátegui",value:"Anzoátegui"},{label:"Apure",value:"Apure"},{label:"Aragua",value:"Aragua"},{label:"Barinas",value:"Barinas"},{label:"Bolívar",value:"Bolívar"},{label:"Carabobo",value:"Carabobo"},{label:"Cojedes",value:"Cojedes"},{label:"Delta Amacuro",value:"Delta Amacuro"},{label:"Distrito Capital",value:"Distrito Capital"},{label:"Falcón",value:"Falcón"},{label:"Guárico",value:"Guárico"},{label:"Lara",value:"Lara"},{label:"La Guaira",value:"La Guaira"},{label:"Mérida",value:"Mérida"},{label:"Miranda",value:"Miranda"},{label:"Monagas",value:"Monagas"},{label:"Nueva Esparta",value:"Nueva Esparta"},{label:"Portuguesa",value:"Portuguesa"},{label:"Sucre",value:"Sucre"},{label:"Táchira",value:"Táchira"},{label:"Trujillo",value:"Trujillo"},{label:"Yaracuy",value:"Yaracuy"},{label:"Zulia",value:"Zulia"}],nna:"both"},{placeholder:"Ciudad de nacimiento",type:"text",name:"ciudad_nacimiento",select:[{estado:"Amazonas",ciudades:[{label:"Seleccionar",value:""},{label:"La Esmeralda (Alto Orinoco)",value:"La Esmeralda (Alto Orinoco)"},{label:"San Fernando de Atabapo (Atabapo)",value:"San Fernando de Atabapo (Atabapo)"},{label:"Puerto Ayacucho (Atures)",value:"Puerto Ayacucho (Atures)"},{label:"Isla Ratón (Autana)",value:"Isla Ratón (Autana)"},{label:"San Juan de Manapiare (Manapiare)",value:"San Juan de Manapiare (Manapiare)"},{label:"Maroa (Maroa)",value:"Maroa (Maroa)"},{label:"San Carlos de Río Negro (Río Negro)",value:"San Carlos de Río Negro (Río Negro)"}]},{estado:"Anzoátegui",ciudades:[{label:"Seleccionar",value:""},{label:"Anaco (Anaco)",value:"Anaco (Anaco)"},{label:"Aragua de Barcelona (Aragua)",value:"Aragua de Barcelona (Aragua)"},{label:"Barcelona (Bolívar)",value:"Barcelona (Bolívar)"},{label:"Clarines (Bruzual)",value:"Clarines (Bruzual)"},{label:"Onoto (Cajigal)",value:"Onoto (Cajigal)"},{label:"Valle de Guanape (Carvajal)",value:"Valle de Guanape (Carvajal)"},{label:"Cantaura (Freites)",value:"Cantaura (Freites)"},{label:"San José de Guanipa (Guanipa)",value:"San José de Guanipa (Guanipa)"},{label:"Guanta (Guanta)",value:"Guanta (Guanta)"},{label:"Soledad (Independencia)",value:"Soledad (Independencia)"},{label:"San Mateo (Libertad)",value:"San Mateo (Libertad)"},{label:"El Chaparro (Sir Arthur McGregor)",value:"El Chaparro (Sir Arthur McGregor)"},{label:"Pariaguán (Miranda)",value:"Pariaguán (Miranda)"},{label:"Mapire (Monagas)",value:"Mapire (Monagas)"},{label:"Puerto Píritu (Peñalver)",value:"Puerto Píritu (Peñalver)"},{label:"Píritu (Píritu)",value:"Píritu (Píritu)"},{label:"Boca de Uchire (San Juan de Capistrano)",value:"Boca de Uchire (San Juan de Capistrano)"},{label:"Santa Ana (Santa Ana)",value:"Santa Ana (Santa Ana)"},{label:"El Tigre (Simón Rodríguez)",value:"El Tigre (Simón Rodríguez)"},{label:"Puerto La Cruz (Sotillo)",value:"Puerto La Cruz (Sotillo)"},{label:"Lechería (Turístico Diego Bautista Urbaneja)",value:"Lechería (Turístico Diego Bautista Urbaneja)"}]},{estado:"Apure",ciudades:[{label:"Seleccionar",value:""},{label:"Achaguas (Achaguas)",value:"Achaguas (Achaguas)"},{label:"Biruaca (Biruaca)",value:"Biruaca (Biruaca)"},{label:"San Juan de Payara (Pedro Camejo)",value:"San Juan de Payara (Pedro Camejo)"},{label:"Bruzual (Muñoz)",value:"Bruzual (Muñoz)"},{label:"Guasdualito (Páez)",value:"Guasdualito (Páez)"},{label:"Elorza (Rómulo Gallegos)",value:"Elorza (Rómulo Gallegos)"},{label:"San Fernando de Apure (San Fernando)",value:"San Fernando de Apure (San Fernando)"}]},{estado:"Aragua",ciudades:[{label:"Seleccionar",value:""},{label:"Santa Rita (Alcántara)",value:"Santa Rita (Alcántara)"},{label:"San Mateo (Bolívar)",value:"San Mateo (Bolívar)"},{label:"Camatagua (Camatagua)",value:"Camatagua (Camatagua)"},{label:"Maracay (Girardot)",value:"Maracay (Girardot)"},{label:"El Limón (Iragorry)",value:"El Limón (Iragorry)"},{label:"Santa Cruz de Aragua (Lamas)",value:"Santa Cruz de Aragua (Lamas)"},{label:"Palo Negro (Libertador)",value:"Palo Negro (Libertador)"},{label:"Turmero (Mariño)",value:"Turmero (Mariño)"},{label:"Las Tejerías (Michelena)",value:"Las Tejerías (Michelena)"},{label:"Ocumare de la Costa (Ocumare de la Costa de Oro)",value:"Ocumare de la Costa (Ocumare de la Costa de Oro)"},{label:"El Consejo (Revenga)",value:"El Consejo (Revenga)"},{label:"La Victoria (Ribas)",value:"La Victoria (Ribas)"},{label:"San Casimiro (San Casimiro)",value:"San Casimiro (San Casimiro)"},{label:"San Sebastián de los Reyes (San Sebastián)",value:"San Sebastián de los Reyes (San Sebastián)"},{label:"Cagua (Sucre)",value:"Cagua (Sucre)"},{label:"Colonia Tovar (Tovar)",value:"Colonia Tovar (Tovar)"},{label:"Barbacoas (Urdaneta)",value:"Barbacoas (Urdaneta)"},{label:"Villa de Cura (Zamora)",value:"Villa de Cura (Zamora)"}]},{estado:"Barinas",ciudades:[{label:"Seleccionar",value:""},{label:"Sabaneta (Alberto Arvelo Torrealba)",value:"Sabaneta (Alberto Arvelo Torrealba)"},{label:"El Cantón (Andrés Eloy Blanco)",value:"El Cantón (Andrés Eloy Blanco)"},{label:"Socopó (Antonio José de Sucre)",value:"Socopó (Antonio José de Sucre)"},{label:"Arismendi (Arismendi)",value:"Arismendi (Arismendi)"},{label:"Barinas (Barinas)",value:"Barinas (Barinas)"},{label:"Barinitas (Bolívar)",value:"Barinitas (Bolívar)"},{label:"Barrancas (Cruz Paredes)",value:"Barrancas (Cruz Paredes)"},{label:"Santa Bárbara (Ezequiel Zamora)",value:"Santa Bárbara (Ezequiel Zamora)"},{label:"Obispos (Obispos)",value:"Obispos (Obispos)"},{label:"Ciudad Bolivia (Pedraza)",value:"Ciudad Bolivia (Pedraza)"},{label:"Libertad (Rojas)",value:"Libertad (Rojas)"},{label:"Ciudad de Nutrias (Sosa)",value:"Ciudad de Nutrias (Sosa)"}]},{estado:"Bolívar",ciudades:[{label:"Seleccionar",value:""},{label:"Ciudad Piar (Angostura)",value:"Ciudad Piar (Angostura)"},{label:"Ciudad Bolívar (Angostura del Orinoco)",value:"Ciudad Bolívar (Angostura del Orinoco)"},{label:"Ciudad Guayana (Caroní)",value:"Ciudad Guayana (Caroní)"},{label:"Caicara del Orinoco (Cedeño)",value:"Caicara del Orinoco (Cedeño)"},{label:"El Palmar (Chien)",value:"El Palmar (Chien)"},{label:"El Callao (El Callao)",value:"El Callao (El Callao)"},{label:"Santa Elena de Uairén (Gran Sabana)",value:"Santa Elena de Uairén (Gran Sabana)"},{label:"Upata (Piar)",value:"Upata (Piar)"},{label:"Guasipati (Roscio)",value:"Guasipati (Roscio)"},{label:"El Dorado (Sifontes)",value:"El Dorado (Sifontes)"},{label:"Maripa (Sucre)",value:"Maripa (Sucre)"}]},{estado:"Carabobo",ciudades:[{label:"Seleccionar",value:""},{label:"Bejuma (Bejuma)",value:"Bejuma (Bejuma)"},{label:"Güigüe (Carlos Arvelo)",value:"Güigüe (Carlos Arvelo)"},{label:"Mariara (Diego Ibarra)",value:"Mariara (Diego Ibarra)"},{label:"Guacara (Guacara)",value:"Guacara (Guacara)"},{label:"Morón (Juan José Mora)",value:"Morón (Juan José Mora)"},{label:"Tocuyito (Libertador)",value:"Tocuyito (Libertador)"},{label:"Los Guayos (Los Guayos)",value:"Los Guayos (Los Guayos)"},{label:"Miranda (Miranda)",value:"Miranda (Miranda)"},{label:"Montalbán (Montalbán)",value:"Montalbán (Montalbán)"},{label:"Naguanagua (Naguanagua)",value:"Naguanagua (Naguanagua)"},{label:"Puerto Cabello (Puerto Cabello)",value:"Puerto Cabello (Puerto Cabello)"},{label:"San Diego (San Diego)",value:"San Diego (San Diego)"},{label:"San Joaquín (San Joaquín)",value:"San Joaquín (San Joaquín)"},{label:"Valencia (Valencia)",value:"Valencia (Valencia)"}]},{estado:"Cojedes",ciudades:[{label:"Seleccionar",value:""},{label:"Cojedes (Anzoátegui)",value:"Cojedes (Anzoátegui)"},{label:"San Carlos (San Carlos)",value:"San Carlos (San Carlos)"},{label:"El Baúl (Girardot)",value:"El Baúl (Girardot)"},{label:"Macapo (Lima Blanco)",value:"Macapo (Lima Blanco)"},{label:"El Pao (Pao de San Juan Bautista)",value:"El Pao (Pao de San Juan Bautista)"},{label:"Libertad (Ricaurte)",value:"Libertad (Ricaurte)"},{label:"Las Vegas (Rómulo Gallegos)",value:"Las Vegas (Rómulo Gallegos)"},{label:"Tinaco (Tinaco)",value:"Tinaco (Tinaco)"},{label:"Tinaquillo (Tinaquillo)",value:"Tinaquillo (Tinaquillo)"}]},{estado:"Delta Amacuro",ciudades:[{label:"Seleccionar",value:""},{label:"Curiapo (Antonio Díaz)",value:"Curiapo (Antonio Díaz)"},{label:"Sierra Imataca (Casacoima)",value:"Sierra Imataca (Casacoima)"},{label:"Pedernales (Pedernales)",value:"Pedernales (Pedernales)"},{label:"Tucupita (Tucupita)",value:"Tucupita (Tucupita)"}]},{estado:"Distrito Capital",ciudades:[{label:"Seleccionar",value:""},{label:"Caracas (Libertador)",value:"Caracas (Libertador)"}]},{estado:"Falcón",ciudades:[{label:"Seleccionar",value:""},{label:"San Juan de los Cayos (Acosta)",value:"San Juan de los Cayos (Acosta)"},{label:"San Luis (Bolívar)",value:"San Luis (Bolívar)"},{label:"Capatárida (Buchivacoa)",value:"Capatárida (Buchivacoa)"},{label:"Punto Fijo (Carirubana)",value:"Punto Fijo (Carirubana)"},{label:"La Vela de Coro (Colina)",value:"La Vela de Coro (Colina)"},{label:"Dabajuro (Dabajuro)",value:"Dabajuro (Dabajuro)"},{label:"Pedregal (Democracia)",value:"Pedregal (Democracia)"},{label:"Pueblo Nuevo (Falcón)",value:"Pueblo Nuevo (Falcón)"},{label:"Churuguara (Federación)",value:"Churuguara (Federación)"},{label:"Chichiriviche (Iturriza)",value:"Chichiriviche (Iturriza)"},{label:"Jacura (Jacura)",value:"Jacura (Jacura)"},{label:"Santa Cruz de Los Taques (Los Taques)",value:"Santa Cruz de Los Taques (Los Taques)"},{label:"Yaracal (Manaure)",value:"Yaracal (Manaure)"},{label:"Mene de Mauroa (Mauroa)",value:"Mene de Mauroa (Mauroa)"},{label:"Santa Ana de Coro (Miranda)",value:"Santa Ana de Coro (Miranda)"},{label:"Palmasola (Palmasola)",value:"Palmasola (Palmasola)"},{label:"Cabure (Petit)",value:"Cabure (Petit)"},{label:"Píritu (Píritu)",value:"Píritu (Píritu)"},{label:"Mirimire (San Francisco)",value:"Mirimire (San Francisco)"},{label:"La Cruz de Taratara (Sucre)",value:"La Cruz de Taratara (Sucre)"},{label:"Tucacas (Silva)",value:"Tucacas (Silva)"},{label:"Tocópero (Tocópero)",value:"Tocópero (Tocópero)"},{label:"Santa Cruz de Bucaral (Unión)",value:"Santa Cruz de Bucaral (Unión)"},{label:"Urumaco (Urumaco)",value:"Urumaco (Urumaco)"},{label:"Puerto Cumarebo (Zamora)",value:"Puerto Cumarebo (Zamora)"}]},{estado:"Guárico",ciudades:[{label:"Seleccionar",value:""},{label:"Camaguán (Camaguán)",value:"Camaguán (Camaguán)"},{label:"Chaguaramas (Chaguaramas)",value:"Chaguaramas (Chaguaramas)"},{label:"El Socorro (El Socorro)",value:"El Socorro (El Socorro)"},{label:"Calabozo (Francisco de Miranda)",value:"Calabozo (Francisco de Miranda)"},{label:"Tucupido (José Félix Ribas)",value:"Tucupido (José Félix Ribas)"},{label:"Altagracia de Orituco (José Tadeo Monagas)",value:"Altagracia de Orituco (José Tadeo Monagas)"},{label:"San Juan de los Morros (Juan Germán Roscio)",value:"San Juan de los Morros (Juan Germán Roscio)"},{label:"Las Mercedes (Juan José Rondón)",value:"Las Mercedes (Juan José Rondón)"},{label:"El Sombrero (Julián Mellado)",value:"El Sombrero (Julián Mellado)"},{label:"Valle de La Pascua (Leonardo Infante)",value:"Valle de La Pascua (Leonardo Infante)"},{label:"Ortiz (Ortiz)",value:"Ortiz (Ortiz)"},{label:"Guayabal (San Gerónimo de Guayabal)",value:"Guayabal (San Gerónimo de Guayabal)"},{label:"San José de Guaribe (San José de Guaribe)",value:"San José de Guaribe (San José de Guaribe)"},{label:"Santa María de Ipire (Santa María de Ipire)",value:"Santa María de Ipire (Santa María de Ipire)"},{label:"Zaraza (Zaraza)",value:"Zaraza (Zaraza)"}]},{estado:"Lara",ciudades:[{label:"Seleccionar",value:""},{label:"Sanare (Andrés Eloy Blanco)",value:"Sanare (Andrés Eloy Blanco)"},{label:"Duaca (Crespo)",value:"Duaca (Crespo)"},{label:"Barquisimeto (Iribarren)",value:"Barquisimeto (Iribarren)"},{label:"Quibor (Jiménez)",value:"Quibor (Jiménez)"},{label:"El Tocuyo (Morán)",value:"El Tocuyo (Morán)"},{label:"Cabudare (Palavecino)",value:"Cabudare (Palavecino)"},{label:"Sarare (Simón Planas)",value:"Sarare (Simón Planas)"},{label:"Carora (Torres)",value:"Carora (Torres)"},{label:"Siquisique (Urdaneta)",value:"Siquisique (Urdaneta)"},{label:"La Guaira (Vargas)",value:"La Guaira (Vargas)"}]},{estado:"La Guaira",ciudades:[{label:"Seleccionar",value:""},{label:"La Guaira",value:"La Guaira"},{label:"Caraballeda",value:"Caraballeda"},{label:"Carayaca",value:"Carayaca"},{label:"Naiguatá",value:"Naiguatá"},{label:"Macuto",value:"Macuto"},{label:"Maiquetía",value:"Maiquetía"},{label:"Táriba",value:"Táriba"}]},{estado:"Mérida",ciudades:[{label:"Seleccionar",value:""},{label:"El Vigía (Alberto Adriani)",value:"El Vigía (Alberto Adriani)"},{label:"La Azulita (Andrés Bello)",value:"La Azulita (Andrés Bello)"},{label:"Santa Cruz de Mora (Antonio Pinto Salinas)",value:"Santa Cruz de Mora (Antonio Pinto Salinas)"},{label:"Aricagua (Aricagua)",value:"Aricagua (Aricagua)"},{label:"Canaguá (Arzobispo Chacón)",value:"Canaguá (Arzobispo Chacón)"},{label:"Ejido (Campo Elías)",value:"Ejido (Campo Elías)"},{label:"Tucaní (Caracciolo Parra Olmedo)",value:"Tucaní (Caracciolo Parra Olmedo)"},{label:"Santo Domingo (Cardenal Quintero)",value:"Santo Domingo (Cardenal Quintero)"},{label:"Guaraque (Guaraque)",value:"Guaraque (Guaraque)"},{label:"Arapuey (Julio Cesar Salas)",value:"Arapuey (Julio Cesar Salas)"},{label:"Torondoy (Justo Briceño)",value:"Torondoy (Justo Briceño)"},{label:"Mérida (Libertador)",value:"Mérida (Libertador)"},{label:"Timotes (Miranda)",value:"Timotes (Miranda)"},{label:"Santa Elena de Arenales (Obispo Ramos de Lora)",value:"Santa Elena de Arenales (Obispo Ramos de Lora)"},{label:"Santa María de Caparo (Padre Noguera)",value:"Santa María de Caparo (Padre Noguera)"},{label:"Pueblo Llano (Pueblo Llano)",value:"Pueblo Llano (Pueblo Llano)"},{label:"Mucuchíes (Rangel)",value:"Mucuchíes (Rangel)"},{label:"Bailadores (Rivas Dávila)",value:"Bailadores (Rivas Dávila)"},{label:"Tabay (Santos Marquina)",value:"Tabay (Santos Marquina)"},{label:"Lagunillas (Sucre)",value:"Lagunillas (Sucre)"},{label:"Tovar (Tovar)",value:"Tovar (Tovar)"},{label:"Nueva Bolivia (Tulio Febres Cordero)",value:"Nueva Bolivia (Tulio Febres Cordero)"},{label:"Zea (Zea)",value:"Zea (Zea)"}]},{estado:"Miranda",ciudades:[{label:"Seleccionar",value:""},{label:"Caucagua (Acevedo)",value:"Caucagua (Acevedo)"},{label:"San José de Barlovento (Andrés Bello)",value:"San José de Barlovento (Andrés Bello)"},{label:"Baruta (Baruta)",value:"Baruta (Baruta)"},{label:"San Francisco de Yare (Bolívar)",value:"San Francisco de Yare (Bolívar)"},{label:"Higuerote (Brión)",value:"Higuerote (Brión)"},{label:"Mamporal (Buroz)",value:"Mamporal (Buroz)"},{label:"Carrizal (Carrizal)",value:"Carrizal (Carrizal)"},{label:"Chacao (Chacao)",value:"Chacao (Chacao)"},{label:"Charallave (Cristóbal Rojas)",value:"Charallave (Cristóbal Rojas)"},{label:"El Hatillo (El Hatillo)",value:"El Hatillo (El Hatillo)"},{label:"Los Teques (Guaicaipuro)",value:"Los Teques (Guaicaipuro)"},{label:"El Jarillo (Guaicaipuro)",value:"El Jarillo (Guaicaipuro)"},{label:"Cúpira (Gual)",value:"Cúpira (Gual)"},{label:"Santa Teresa del Tuy (Independencia)",value:"Santa Teresa del Tuy (Independencia)"},{label:"Ocumare del Tuy (Lander)",value:"Ocumare del Tuy (Lander)"},{label:"San Antonio de los Altos (Los Salias)",value:"San Antonio de los Altos (Los Salias)"},{label:"Río Chico (Páez)",value:"Río Chico (Páez)"},{label:"Santa Lucía (Paz Castillo)",value:"Santa Lucía (Paz Castillo)"},{label:"Guarenas (Plaza)",value:"Guarenas (Plaza)"},{label:"Petare (Sucre)",value:"Petare (Sucre)"},{label:"Cúa (Urdaneta)",value:"Cúa (Urdaneta)"},{label:"Guatire (Zamora)",value:"Guatire (Zamora)"}]},{estado:"Monagas",ciudades:[{label:"Seleccionar",value:""},{label:"San Antonio de Capayacuar (Acosta)",value:"San Antonio de Capayacuar (Acosta)"},{label:"Aguasay (Aguasay)",value:"Aguasay (Aguasay)"},{label:"Caripito (Bolívar)",value:"Caripito (Bolívar)"},{label:"Caripe (Caripe)",value:"Caripe (Caripe)"},{label:"Caicara de Maturín (Cedeño)",value:"Caicara de Maturín (Cedeño)"},{label:"Temblador (Libertador)",value:"Temblador (Libertador)"},{label:"Maturín (Maturín)",value:"Maturín (Maturín)"},{label:"Aragua de Maturín (Piar)",value:"Aragua de Maturín (Piar)"},{label:"Quiriquire (Punceres)",value:"Quiriquire (Punceres)"},{label:"Santa Bárbara (Santa Bárbara)",value:"Santa Bárbara (Santa Bárbara)"},{label:"Barrancas del Orinoco (Sotillo)",value:"Barrancas del Orinoco (Sotillo)"},{label:"Uracoa (Uracoa)",value:"Uracoa (Uracoa)"},{label:"Punta de Mata (Zamora)",value:"Punta de Mata (Zamora)"}]},{estado:"Nueva Esparta",ciudades:[{label:"Seleccionar",value:""},{label:"La Plaza de Paraguachí (Antolín del Campo)",value:"La Plaza de Paraguachí (Antolín del Campo)"},{label:"San Juan Bautista (Antonio Díaz)",value:"San Juan Bautista (Antonio Díaz)"},{label:"La Asunción (Arismendi)",value:"La Asunción (Arismendi)"},{label:"El Valle (García)",value:"El Valle (García)"},{label:"Santa Ana (Gómez)",value:"Santa Ana (Gómez)"},{label:"Boca de Río (Macanao)",value:"Boca de Río (Macanao)"},{label:"Pampatar (Maneiro)",value:"Pampatar (Maneiro)"},{label:"Juan Griego (Marcano)",value:"Juan Griego (Marcano)"},{label:"Porlamar (Mariño)",value:"Porlamar (Mariño)"},{label:"Punta de Piedras (Tubores)",value:"Punta de Piedras (Tubores)"},{label:"San Pedro de Coche (Villalba)",value:"San Pedro de Coche (Villalba)"}]},{estado:"Portuguesa",ciudades:[{label:"Seleccionar",value:""},{label:"Agua Blanca (Agua Blanca)",value:"Agua Blanca (Agua Blanca)"},{label:"Araure (Araure)",value:"Araure (Araure)"},{label:"Píritu (Esteller)",value:"Píritu (Esteller)"},{label:"Guanare (Guanare)",value:"Guanare (Guanare)"},{label:"Guanarito (Guanarito)",value:"Guanarito (Guanarito)"},{label:"Chabasquén (José Vicente de Unda)",value:"Chabasquén (José Vicente de Unda)"},{label:"Ospino (Ospino)",value:"Ospino (Ospino)"},{label:"Acarigua (Páez)",value:"Acarigua (Páez)"},{label:"Papelón (Papelón)",value:"Papelón (Papelón)"},{label:"Boconoíto (San Genaro de Boconoíto)",value:"Boconoíto (San Genaro de Boconoíto)"},{label:"San Rafael de Onoto (San Rafael de Onoto)",value:"San Rafael de Onoto (San Rafael de Onoto)"},{label:"El Playón (Santa Rosalía)",value:"El Playón (Santa Rosalía)"},{label:"Biscucuy (Sucre)",value:"Biscucuy (Sucre)"},{label:"Villa Bruzual (Turén)",value:"Villa Bruzual (Turén)"}]},{estado:"Sucre",ciudades:[{label:"Seleccionar",value:""},{label:"Casanay (Andrés Eloy Blanco)",value:"Casanay (Andrés Eloy Blanco)"},{label:"San José de Aerocuar (Andrés Mata)",value:"San José de Aerocuar (Andrés Mata)"},{label:"Río Caribe (Arismendi)",value:"Río Caribe (Arismendi)"},{label:"El Pilar (Benítez)",value:"El Pilar (Benítez)"},{label:"Carúpano (Bermúdez)",value:"Carúpano (Bermúdez)"},{label:"Marigüitar (Bolívar)",value:"Marigüitar (Bolívar)"},{label:"Yaguaraparo (Cajigal)",value:"Yaguaraparo (Cajigal)"},{label:"Araya (Cruz Salmerón Acosta)",value:"Araya (Cruz Salmerón Acosta)"},{label:"Tunapuy (Libertador)",value:"Tunapuy (Libertador)"},{label:"Irapa (Mariño)",value:"Irapa (Mariño)"},{label:"San Antonio del Golfo (Mejía)",value:"San Antonio del Golfo (Mejía)"},{label:"Cumanacoa (Montes)",value:"Cumanacoa (Montes)"},{label:"Cariaco (Ribero)",value:"Cariaco (Ribero)"},{label:"Cumaná (Sucre)",value:"Cumaná (Sucre)"},{label:"Güiria (Valdez)",value:"Güiria (Valdez)"}]},{estado:"Táchira",ciudades:[{label:"Seleccionar",value:""},{label:"Cordero (Andrés Bello)",value:"Cordero (Andrés Bello)"},{label:"Las Mesas (Antonio Rómulo Costa)",value:"Las Mesas (Antonio Rómulo Costa)"},{label:"Colón (Ayacucho)",value:"Colón (Ayacucho)"},{label:"San Antonio del Táchira (Bolívar)",value:"San Antonio del Táchira (Bolívar)"},{label:"Táriba (Cárdenas)",value:"Táriba (Cárdenas)"},{label:"Santa Ana de Táchira (Córdoba)",value:"Santa Ana de Táchira (Córdoba)"},{label:"San Rafael del Piñal (Fernández)",value:"San Rafael del Piñal (Fernández)"},{label:"San José de Bolívar (Francisco de Miranda)",value:"San José de Bolívar (Francisco de Miranda)"},{label:"La Fría (García de Hevia)",value:"La Fría (García de Hevia)"},{label:"Palmira (Guásimos)",value:"Palmira (Guásimos)"},{label:"Capacho Nuevo (Independencia)",value:"Capacho Nuevo (Independencia)"},{label:"La Grita (Jáuregui)",value:"La Grita (Jáuregui)"},{label:"El Cobre (José María Vargas)",value:"El Cobre (José María Vargas)"},{label:"Rubio (Junín)",value:"Rubio (Junín)"},{label:"Capacho Viejo (Libertad)",value:"Capacho Viejo (Libertad)"},{label:"Abejales (Libertador)",value:"Abejales (Libertador)"},{label:"Lobatera (Lobatera)",value:"Lobatera (Lobatera)"},{label:"Michelena (Michelena)",value:"Michelena (Michelena)"},{label:"Coloncito (Panamericano)",value:"Coloncito (Panamericano)"},{label:"Ureña (Pedro María Ureña)",value:"Ureña (Pedro María Ureña)"},{label:"Delicias (Rafael Urdaneta)",value:"Delicias (Rafael Urdaneta)"},{label:"La Tendida (Samuel Dario Maldonado)",value:"La Tendida (Samuel Dario Maldonado)"},{label:"San Cristóbal (San Cristóbal)",value:"San Cristóbal (San Cristóbal)"},{label:"Umuquena (San Judas Tadeo)",value:"Umuquena (San Judas Tadeo)"},{label:"Seboruco (Seboruco)",value:"Seboruco (Seboruco)"},{label:"San Simón (Simón Rodríguez)",value:"San Simón (Simón Rodríguez)"},{label:"Queniquea (Sucre)",value:"Queniquea (Sucre)"},{label:"San Josecito (Torbes)",value:"San Josecito (Torbes)"},{label:"Pregonero (Uribante)",value:"Pregonero (Uribante)"}]},{estado:"Trujillo",ciudades:[{label:"Seleccionar",value:""},{label:"Santa Isabel (Andrés Bello)",value:"Santa Isabel (Andrés Bello)"},{label:"Boconó (Boconó)",value:"Boconó (Boconó)"},{label:"Sabana Grande (Bolívar)",value:"Sabana Grande (Bolívar)"},{label:"Chejendé (Candelaria)",value:"Chejendé (Candelaria)"},{label:"Carache (Carache)",value:"Carache (Carache)"},{label:"Carvajal (Carvajal)",value:"Carvajal (Carvajal)"},{label:"Escuque (Escuque)",value:"Escuque (Escuque)"},{label:"Campo Elías (Juan Vicente Campo Elías)",value:"Campo Elías (Juan Vicente Campo Elías)"},{label:"Santa Apolonia (La Ceiba)",value:"Santa Apolonia (La Ceiba)"},{label:"El Paradero (Márquez Cañizales)",value:"El Paradero (Márquez Cañizales)"},{label:"El Dividive (Miranda)",value:"El Dividive (Miranda)"},{label:"Monte Carmelo (Monte Carmelo)",value:"Monte Carmelo (Monte Carmelo)"},{label:"Motatán (Motatán)",value:"Motatán (Motatán)"},{label:"Pampán (Pampán)",value:"Pampán (Pampán)"},{label:"Pampanito (Pampanito)",value:"Pampanito (Pampanito)"},{label:"Betijoque (Rangel)",value:"Betijoque (Rangel)"},{label:"Sabana de Mendoza (Sucre)",value:"Sabana de Mendoza (Sucre)"},{label:"Trujillo (Trujillo)",value:"Trujillo (Trujillo)"},{label:"La Quebrada (Urdaneta)",value:"La Quebrada (Urdaneta)"},{label:"Valera (Valera)",value:"Valera (Valera)"}]},{estado:"Yaracuy",ciudades:[{label:"Seleccionar",value:""},{label:"San Pablo (Arístides Bastidas)",value:"San Pablo (Arístides Bastidas)"},{label:"Aroa (Bolívar)",value:"Aroa (Bolívar)"},{label:"Chivacoa (Bruzual)",value:"Chivacoa (Bruzual)"},{label:"Cocorote (Cocorote)",value:"Cocorote (Cocorote)"},{label:"Independencia (Independencia)",value:"Independencia (Independencia)"},{label:"Sabana de Parra (José Antonio Páez)",value:"Sabana de Parra (José Antonio Páez)"},{label:"Boraure (La Trinidad)",value:"Boraure (La Trinidad)"},{label:"Yumare (Manuel Monge)",value:"Yumare (Manuel Monge)"},{label:"Nirgua (Nirgua)",value:"Nirgua (Nirgua)"},{label:"Yaritagua (Peña)",value:"Yaritagua (Peña)"},{label:"San Felipe (San Felipe)",value:"San Felipe (San Felipe)"},{label:"Guama (Sucre)",value:"Guama (Sucre)"},{label:"Urachiche (Urachiche)",value:"Urachiche (Urachiche)"},{label:"Farriar (Veroes)",value:"Farriar (Veroes)"}]},{estado:"Zulia",ciudades:[{label:"Seleccionar",value:""},{label:"El Toro (Almirante Padilla)",value:"El Toro (Almirante Padilla)"},{label:"San Timoteo (Baralt)",value:"San Timoteo (Baralt)"},{label:"Cabimas (Cabimas)",value:"Cabimas (Cabimas)"},{label:"Encontrados (Catatumbo)",value:"Encontrados (Catatumbo)"},{label:"San Carlos del Zulia (Colón)",value:"San Carlos del Zulia (Colón)"},{label:"Pueblo Nuevo-El Chivo (Francisco Javier Pulgar)",value:"Pueblo Nuevo-El Chivo (Francisco Javier Pulgar)"},{label:"Sinamaica (Guajira)",value:"Sinamaica (Guajira)"},{label:"La Concepción (Jesús Enrique Lossada)",value:"La Concepción (Jesús Enrique Lossada)"},{label:"Casigua El Cubo (Jesús María Semprún)",value:"Casigua El Cubo (Jesús María Semprún)"},{label:"Concepción (La Cañada de Urdaneta)",value:"Concepción (La Cañada de Urdaneta)"},{label:"Ciudad Ojeda (Lagunillas)",value:"Ciudad Ojeda (Lagunillas)"},{label:"Machiques (Machiques de Perijá)",value:"Machiques (Machiques de Perijá)"},{label:"San Rafael del Moján (Mara)",value:"San Rafael del Moján (Mara)"},{label:"Maracaibo (Maracaibo)",value:"Maracaibo (Maracaibo)"},{label:"Los Puertos de Altagracia (Miranda)",value:"Los Puertos de Altagracia (Miranda)"},{label:"La Villa del Rosario (Rosario de Perijá)",value:"La Villa del Rosario (Rosario de Perijá)"},{label:"San Francisco (San Francisco)",value:"San Francisco (San Francisco)"},{label:"Santa Rita (Santa Rita)",value:"Santa Rita (Santa Rita)"},{label:"Tía Juana (Simón Bolívar)",value:"Tía Juana (Simón Bolívar)"},{label:"Bobures (Sucre)",value:"Bobures (Sucre)"},{label:"Bachaquero (Valmore Rodríguez)",value:"Bachaquero (Valmore Rodríguez)"}]}],nna:"both"},{placeholder:"Sexo",type:"text",name:"sexo",select:[{label:"Seleccionar",value:""},{label:"Masculino",value:"Masculino"},{label:"Femenino",value:"Femenino"}],nna:"both"},{placeholder:"Domicilio (Sin abreviaturas) - Ej.: Calle 1 Avenida 1, CP 40123, Pachuca de Soto, Hidalgo",type:"text",name:"address",nna:"both"},{placeholder:"Teléfono para videollamada - Ej.: +52 5560644470",type:"text",name:"telefono"},{placeholder:"Correo electrónico - Ej.: tucorreo@embajada.com",type:"email",name:"correo_electronico",nna:"both"}]},Nz="/assets/manual_visa-tTxTmId_.pdf",Oz={airtable:{base:"appEIWO8RB2ELZZzx",tabla:"visa_vzla"},dropbox:{folder:"visa_vzla"},files:[{title:"Foto tipo pasaporte / Passport type photo",actionButton:"Subir imagen / Upload image",file:mh,accept:".jpg",name:"foto"},{title:"Documento PDF del solicitante / Applicant's PDF Document",actionButton:"Subir PDF / Upload PDF",file:Nz,accept:".pdf",name:"pdf"}],form:`

CONSULTA DE VISA

NOMBRE COMPLETO: {{firstName}} {{lastName}}

FECHA NACIMIENTO: {{fecha_nacimiento}}

EDAD: {{edad}}

ESTADO CIVIL: {{estado_civil}}

RESIDENCIA LEGAL EN: {{pais_residencia}}

NACIONALIDAD: {{nacionalidad}}

TIPO DE PASAPORTE: {{tipo_pasaporte}}

N° PASAPORTE: {{numero_pasaporte}}

TIPO DE VISA SOLICITADA: VISA DE {{visa_type}}

PROFESION U OCUPACIÓN: {{profesion_ocupacion}}

INSTITUCIÓN O EMPRESA: {{institution}}

HA VISITADO VENEZUELA ANTERIORMENTE: {{venezuela_previous}}

LUGAR DE ALOJAMIENTO EN VENEZUELA: {{alojamiento}}

MOTIVO DEL VIAJE A VENEZUELA: {{motivo_viaje}}

VALORACIÓN DEL PERFIL

EL (LA) SOLICITANTE, DE {{edad}} CUMPLIDOS, DE ESTADO CIVIL {{estado_civil}}, ES DE NACIONALIDAD {{nacionalidad}}, DE PROFESION U OCUPACION {{profesion_ocupacion}} EN {{institution}}, EL CUAL RESIDE EN {{address}}, {{pais_residencia}}.

DESICIÓN E INSTRUCCIONES

APROBADO

NEGADO

VISTO

DIFERIDO

FRANCISCO JAVIER ARIAS CARDENAS

EMBAJADOR

FIRMA JEFE(A)

SECCIÓN CONSULAR

FIRMA FUNCIONARIO(A)

PRESENTANTE

`,instructive:`

El presente instructivo detalla las orientaciones necesarias para realizar la solicitud de un visado, el cual habilita a ciudadanos extranjeros a ingresar, permanecer temporalmente, trabajar, invertir o transitar por el territorio venezolano, cumpliendo con las disposiciones legales y normativas aplicables.

Este trámite es obligatorio exclusivamente para aquellos ciudadanos cuya nacionalidad exige la obtención de una visa para los fines descritos anteriormente.

Es importante destacar que solo podrán presentar su solicitud ante esta Embajada aquellas personas que cuenten con residencia legal en los siguientes países:

  • México
  • Argentina
  • Canadá
  • Chile
  • Costa Rica
  • Ecuador
  • El Salvador
  • Estados Unidos de América
  • Guatemala
  • Honduras
  • Jamaica
  • Panamá
  • Perú
  • República Dominicana
  • Uruguay

El proceso se desarrolla fundamentalmente en formato electrónico, con un tiempo estimado de tramitación de entre 30 y 90 días (indicativo, dependientdo del tipo de visa aplicado). Una vez concluida esta etapa, y en caso de aprobación, será indispensable completar un procedimiento presencial. Cabe destacar que este trámite no contempla un sistema de gestión basado en "citas".

El costo del visado es de 60 dólares estadounidenses, los cuales deben ser abonados al inicio del proceso. El pago puede realizarse en efectivo en las taquillas de la Embajada, ya sea directamente o por medio de una tercera persona con autorización formal.

Es fundamental subrayar que la aprobación del visado está condicionada a estrictos procedimientos de validación. Toda la información suministrada, tanto en el formulario como en los documentos complementarios, deberá ser precisa y estará sujeta a comprobaciones exhaustivas.

Asimismo, se exhorta a los solicitantes a asegurarse de que los números telefónicos proporcionados estén habilitados para recibir llamadas de verificación por parte del funcionario diplomático encargado de procesar la solicitud.

El resultado de su solicitud, ya sea aprobación o rechazo, será comunicado exclusivamente al correo electrónico registrado en el formulario web, desde la dirección de correo electrónico visas@tramitesconsularesvenmex.com. Recomendamos verificar periódicamente su bandeja de entrada, incluyendo la carpeta de correo no deseado, para garantizar la recepción de esta notificación.

Requisitos - Pago del arancel consular entre $50 y $60 USD solo en la sede de la Embajada, depende del tipo de visado.
- Llenar en línea la solicitud en: tramitesconsularesvenmex.com/visa
- Adjuntar foto personal (tipo pasaporte) en formato JPG (fondo blanco, sin gorra, sin lentes, con cabello recogido)
- Adjuntar un archivo en formato PDF que incluya todos los documentos indicados en el Manual de Visa(s), para el tipo de visa al cual aplica. Este archivo también debe incorporar la Planilla de Solicitud, la cual deberá ser completada sin editar, e incluyendo todos los datos requeridos de manera detallada.

Consideraciones importantes - Para realizar este trámite, necesita un pasaporte vigente, (con más de 6 meses de vigencia al momento de ser aprobada la visa) y con hojas disponibles para la etiqueta de visa.
- Si el pago va a realizarlo en la sede de la Sección Consular de la Embajada de la República Bolivariana de Venezuela, este debe ser en efectivo en USD.
- Debe solicitar el código con el que podrá tener acceso a la forma web.
- El tiempo estimado para la aprobación es una referencia general y puede variar significativamente, abarcando un periodo aproximado de entre 30 y 90 días (dependiendo del tipo de visa aplicado).
- La Embajada no proporciona información de seguimiento ni de estatus del trámite, durante el proceso de análsis de la solicitud.
- Le recomendamos amablemente evitar la compra de boletos aéreos hasta contar con la confirmación de que su visa ha sido aprobada.
- En caso de que sea necesario proporcionar o completar algún tipo de documentación, nos pondremos en contacto a través del correo electrónico tramitesconsularesvenmex@gmail.com

Le recordamos que el sistema es autogestionado, por lo que debe prestar especial atención a cada dato ingresado en el formulario.

La Embajada no se hace responsable de ningún perjuicio económico, incluida la pérdida de pagos. La veracidad de la información proporcionada es responsabilidad exclusiva del solicitante.

`,subtitle:"Solicitud de visado / Visa application",title:"Visa",values:[{placeholder:"Número de planilla de pago / Payment form number",type:"text",name:"numero_planilla",nna:"adult"},{placeholder:"País de residencia legal permanente / Country of permanent legal residence",type:"text",name:"pais_residencia",select:[{label:"Seleccionar / Select",value:""},{label:"México",value:"Estados Unidos Mexicanos"},{label:"Argentina",value:"Argentina"},{label:"Canadá",value:"Canadá"},{label:"Chile",value:"Chile"},{label:"Costa Rica",value:"Costa Rica"},{label:"Ecuador",value:"Ecuador"},{label:"El Salvador",value:"El Salvador"},{label:"Estados Unidos de América",value:"Estados Unidos de América"},{label:"Guatemala",value:"Guatemala"},{label:"Honduras",value:"Honduras"},{label:"Jamaica",value:"Jamaica"},{label:"Panamá",value:"Panamá"},{label:"Perú",value:"Perú"},{label:"República Dominicana",value:"República Dominicana"},{label:"Uruguay",value:"Uruguay"}],nna:"both"},{placeholder:"Nombre(s) / First Name",type:"text",name:"firstName"},{placeholder:"Apellido(s) / Last Name",type:"text",name:"lastName"},{placeholder:"Tipo de pasaporte / Passport type",type:"text",name:"tipo_pasaporte",select:[{label:"Seleccionar / Select",value:""},{label:"Ordinario / Ordinary",value:"Ordinario"},{label:"Diplomático / Diplomatic",value:"Diplomatico"},{label:"Oficial / Official",value:"Oficial"},{label:"Otro / Other",value:"Otro"}]},{placeholder:"Número de pasaporte / Passport number - Ej.: 123456789",type:"text",name:"numero_pasaporte"},{placeholder:"Fecha de Nacimiento / Date of birth",type:"date",name:"fecha_nacimiento"},{placeholder:"Nacionalidad / Nationality",type:"text",name:"nacionalidad",select:[{label:"Seleccionar / Select",value:""},{label:"Abjasia / Abkhazian",value:"abjasia"},{label:"Afgana / Afghan",value:"afgana"},{label:"Albanesa / Albanian",value:"albanesa"},{label:"Alemana / German",value:"alemana"},{label:"Andamanense / Andamanese",value:"andamanense"},{label:"Andorrana / Andorran",value:"andorrana"},{label:"Angoleña / Angolan",value:"angoleña"},{label:"Anguilense / Anguillian",value:"anguilense"},{label:"Antiguana y barbudense / Antiguan and Barbudan",value:"antiguana y barbudense"},{label:"Argelina / Algerian",value:"argelina"},{label:"Argentina / Argentine",value:"argentina"},{label:"Armenia / Armenian",value:"armenia"},{label:"Arubeña / Aruban",value:"arubeña"},{label:"Ascensionense / Ascension Islander",value:"ascensionense"},{label:"Australiana / Australian",value:"australiana"},{label:"Austriaca / Austrian",value:"austriaca"},{label:"Azerbaiyana / Azerbaijani",value:"azerbaiyana"},{label:"Bahameña / Bahamian",value:"bahameña"},{label:"Bangladesí / Bangladeshi",value:"bangladesí"},{label:"Bareiní / Bahraini",value:"bareiní"},{label:"Barbadense / Barbadian",value:"barbadense"},{label:"Belarusa / Belarusian",value:"belarusa"},{label:"Belga / Belgian",value:"belga"},{label:"Beliceña / Belizean",value:"beliceña"},{label:"Beninesa / Beninese",value:"beninesa"},{label:"Bermudense / Bermudian",value:"bermudense"},{label:"Butanesa / Bhutanese",value:"butanesa"},{label:"Boliviana / Bolivian",value:"boliviana"},{label:"Bonaerense / Bonairean",value:"bonaerense"},{label:"Bosnia / Bosnian",value:"bosnia"},{label:"Botswanesa / Botswanan",value:"botswanesa"},{label:"Bouvetense / Bouvet Islander",value:"bouvetense"},{label:"Brasileña / Brazilian",value:"brasileña"},{label:"Bruneana / Bruneian",value:"bruneana"},{label:"Búlgara / Bulgarian",value:"búlgara"},{label:"Burkinesa / Burkinabe",value:"burkinesa"},{label:"Burundesa / Burundian",value:"burundesa"},{label:"Camboyana / Cambodian",value:"camboyana"},{label:"Caboverdiana / Cape Verdean",value:"caboverdiana"},{label:"Caimaneses / Caymanian",value:"caimaneses"},{label:"Camerunesa / Cameroonian",value:"camerunesa"},{label:"Canadiense / Canadian",value:"canadiense"},{label:"Canaria / Canarian",value:"canaria"},{label:"Centroafricana / Central African",value:"centroafricana"},{label:"Chadiana / Chadian",value:"chadiana"},{label:"Chilena / Chilean",value:"chilena"},{label:"China / Chinese",value:"china"},{label:"Chipriota / Cypriot",value:"chipriota"},{label:"Colombiana / Colombian",value:"colombiana"},{label:"Comorense / Comoran",value:"comorense"},{label:"Congoleña (República Democrática del Congo) / Congolese (Democratic Republic of Congo)",value:"congoleña - republica democratica"},{label:"Congoleña (República del Congo) / Congolese (Republic of Congo)",value:"congoleña"},{label:"Cookiana / Cook Islander",value:"cookiana"},{label:"Costarricense / Costa Rican",value:"costarricense"},{label:"Croata / Croatian",value:"croata"},{label:"Cubana / Cuban",value:"cubana"},{label:"Curaçaoense / Curaçaoan",value:"curaçaoense"},{label:"Danesa / Danish",value:"danesa"},{label:"Dominicana / Dominican",value:"dominicana"},{label:"Ecuatoriana / Ecuadorian",value:"ecuatoriana"},{label:"Egipcia / Egyptian",value:"egipcia"},{label:"Emiratí / Emirati",value:"emiratí"},{label:"Eritrea / Eritrean",value:"eritrea"},{label:"Estadounidense / American",value:"estadounidense"},{label:"Estonia / Estonian",value:"estonia"},{label:"Etíope / Ethiopian",value:"etiope"},{label:"Feroesa / Faroese",value:"feroesa"},{label:"Fiyiana / Fijian",value:"fiyiana"},{label:"Filipina / Filipino",value:"filipina"},{label:"Finlandesa / Finnish",value:"finlandesa"},{label:"Francesa / French",value:"francesa"},{label:"Gabonesa / Gabonese",value:"gabonesa"},{label:"Gambiana / Gambian",value:"gambiana"},{label:"Georgiana / Georgian",value:"georgiana"},{label:"Ghanesa / Ghanaian",value:"ghanesa"},{label:"Griega / Greek",value:"griega"},{label:"Groenlandesa / Greenlandic",value:"groenlandesa"},{label:"Guatemalteca / Guatemalan",value:"guatemalteca"},{label:"Guameña / Guamanian",value:"guameña"},{label:"Guineana / Guinean",value:"guineana"},{label:"Guineana Ecuatorial / Equatorial Guinean",value:"ecuatoguineana"},{label:"Guineana-Bisau / Bissau-Guinean",value:"bisauguineana"},{label:"Guyanesa / Guyanese",value:"guyanesa"},{label:"Haitiana / Haitian",value:"haitiana"},{label:"Hondureña / Honduran",value:"hondureña"},{label:"Húngara / Hungarian",value:"húngara"},{label:"Islandesa / Icelandic",value:"islandesa"},{label:"India / Indian",value:"india"},{label:"Indonesia / Indonesian",value:"indonesia"},{label:"Irakí / Iraqi",value:"iraquí"},{label:"Iraní / Iranian",value:"iraní"},{label:"Irlandesa / Irish",value:"irlandesa"},{label:"Isleña / Manx",value:"isleña"},{label:"Israelí / Israeli",value:"israelí"},{label:"Italiana / Italian",value:"italiana"},{label:"Jamaiquina / Jamaican",value:"jamaiquina"},{label:"Japonesa / Japanese",value:"japonesa"},{label:"Jordana / Jordanian",value:"jordana"},{label:"Kazaja / Kazakh",value:"kazaja"},{label:"Keniata / Kenyan",value:"keniata"},{label:"Kirguisa / Kyrgyz",value:"kirguisa"},{label:"Kiribatiana / I-Kiribati",value:"kiribatiana"},{label:"Kuwaití / Kuwaiti",value:"kuwaití"},{label:"Laosiana / Lao",value:"laosiana"},{label:"Letona / Latvian",value:"letona"},{label:"Libanesa / Lebanese",value:"libanesa"},{label:"Lesotense / Basotho",value:"lesotense"},{label:"Liberiana / Liberian",value:"liberiana"},{label:"Libia / Libyan",value:"libia"},{label:"Liechtensteiniana / Liechtensteiner",value:"liechtensteiniana"},{label:"Lituana / Lithuanian",value:"lituana"},{label:"Luxemburguesa / Luxembourger",value:"luxemburguesa"},{label:"Macedonia / Macedonian",value:"macedonia"},{label:"Macaoense / Macanese",value:"macaoense"},{label:"Madagascarense / Malagasy",value:"madagascarense"},{label:"Malasia / Malaysian",value:"malasia"},{label:"Malauí / Malawian",value:"malauí"},{label:"Maldiva / Maldivian",value:"maldiva"},{label:"Maliense / Malian",value:"maliense"},{label:"Maltesa / Maltese",value:"maltesa"},{label:"Mariana del Norte / Northern Marianan",value:"marianense"},{label:"Marfileña / Ivorian",value:"marfileña"},{label:"Marroquí / Moroccan",value:"marroquí"},{label:"Marshalés / Marshallese",value:"marshalés"},{label:"Mauriciana / Mauritian",value:"mauriciana"},{label:"Mauritana / Mauritanian",value:"mauritana"},{label:"Mexicana / Mexican",value:"mexicana"},{label:"Micronesia / Micronesian",value:"micronesia"},{label:"Moldava / Moldovan",value:"moldava"},{label:"Monegasca / Monégasque",value:"monegasca"},{label:"Mongola / Mongolian",value:"mongola"},{label:"Montenegrina / Montenegrin",value:"montenegrina"},{label:"Montserratense / Montserratian",value:"montserratense"},{label:"Mozambique / Mozambican",value:"mozambique"},{label:"Myanmarense / Burmese",value:"myanmarense"},{label:"Namibia / Namibian",value:"namibia"},{label:"Nauruana / Nauruan",value:"nauruana"},{label:"Nepalesa / Nepalese",value:"nepalesa"},{label:"Neozelandesa / New Zealander",value:"neozelandesa"},{label:"Nicaragüense / Nicaraguan",value:"nicaragüense"},{label:"Nieuense / Niuean",value:"nieuense"},{label:"Níger / Nigerien",value:"níger"},{label:"Nigeriana / Nigerian",value:"nigeriana"},{label:"Norcoreana / North Korean",value:"norcoreana"},{label:"Norfolkiana / Norfolk Islander",value:"norfolkiana"},{label:"Noruega / Norwegian",value:"noruega"},{label:"Omaní / Omani",value:"omaní"},{label:"Osetia del Sur / South Ossetian",value:"oseta"},{label:"Países Bajos / Dutch",value:"neerlandesa"},{label:"Paquistaní / Pakistani",value:"paquistaní"},{label:"Palauana / Palauan",value:"palauana"},{label:"Palestina / Palestinian",value:"palestina"},{label:"Panameña / Panamanian",value:"panameña"},{label:"Papúa Nueva Guinea / Papua New Guinean",value:"papú"},{label:"Paraguaya / Paraguayan",value:"paraguaya"},{label:"Peruana / Peruvian",value:"peruana"},{label:"Pitcairnesa / Pitcairn Islander",value:"pitcairnesa"},{label:"Polaca / Polish",value:"polaca"},{label:"Portuguesa / Portuguese",value:"portuguesa"},{label:"Qatarí / Qatari",value:"qatarí"},{label:"Reino Unido / British",value:"reino_unido"},{label:"Ruandesa / Rwandan",value:"ruandesa"},{label:"Rumana / Romanian",value:"rumana"},{label:"Rusa / Russian",value:"rusa"},{label:"Salvadoreña / Salvadoran",value:"salvadoreña"},{label:"Salomonense / Solomon Islander",value:"salomonense"},{label:"Samoana / Samoan",value:"samoana"},{label:"San Cristóbal y Nieves / Kittitian and Nevisian",value:"sancristobalena y nieves"},{label:"San Marino / Sammarinese",value:"sanmarinense"},{label:"Santa Lucía / Saint Lucian",value:"santalucense"},{label:"Santotomense / São Toméan",value:"santotomense"},{label:"Saharaui / Sahrawi",value:"saharaui"},{label:"Saudí / Saudi",value:"saudí"},{label:"Senegalesa / Senegalese",value:"senegalesa"},{label:"Serbia / Serbian",value:"serbia"},{label:"Seychellense / Seychellois",value:"seychellense"},{label:"Sierra Leona / Sierra Leonean",value:"sierraleonesa"},{label:"Singapurense / Singaporean",value:"singapurense"},{label:"Siria / Syrian",value:"siria"},{label:"Somalí / Somali",value:"somalí"},{label:"Sri Lanka / Sri Lankan",value:"ceilanesa"},{label:"Suazilandesa / Eswatini",value:"suazilandesa"},{label:"Sudafricana / South African",value:"sudafricana"},{label:"Sudanesa / Sudanese",value:"sudanesa"},{label:"Sueca / Swedish",value:"sueca"},{label:"Suiza / Swiss",value:"suiza"},{label:"Surcoreana / South Korean",value:"surcoreana"},{label:"Surinamesa / Surinamese",value:"surinamesa"},{label:"Svalbardense / Svalbardian",value:"svalbardense"},{label:"Tailandesa / Thai",value:"tailandesa"},{label:"Tanzana / Tanzanian",value:"tanzana"},{label:"Tayika / Tajik",value:"tayika"},{label:"Timorense / Timorese",value:"timorense"},{label:"Togolesa / Togolese",value:"togolesa"},{label:"Tokelauense / Tokelauan",value:"tokelauense"},{label:"Trinitense / Trinidadian",value:"trinitense"},{label:"Tunecina / Tunisian",value:"tunecina"},{label:"Turca / Turkish",value:"turca"},{label:"Tuvaluana / Tuvaluan",value:"tuvaluana"},{label:"Ucraniana / Ukrainian",value:"ucraniana"},{label:"Ugandesa / Ugandan",value:"ugandesa"},{label:"Uruguaya / Uruguayan",value:"uruguaya"},{label:"Uzbeca / Uzbek",value:"uzbeca"},{label:"Vanuatuense / Ni-Vanuatu",value:"vanuatuense"},{label:"Vietnamita / Vietnamese",value:"vietnamita"},{label:"Wakeense / Wake Islander",value:"wakeense"},{label:"Wallisiana / Wallisian",value:"wallisiana"},{label:"Yemení / Yemeni",value:"yemení"},{label:"Zambiana / Zambian",value:"zambiana"},{label:"Zimbabuense / Zimbabwean",value:"zimbabuense"}]},{placeholder:"Posee otra nacionalidad? (Ser específico) / Do you hold another nationality? (Please provide details)",type:"text",name:"other_nationality",apply:!0},{placeholder:"Estado civil / Marital status",type:"text",name:"estado_civil",select:[{label:"Seleccionar / Select",value:""},{label:"Soltero(a) / Single",value:"Soltero(a)"},{label:"Casado(a) / Married",value:"Casado(a)"},{label:"Divorciado(a) / Divorced",value:"Divorciado(a)"},{label:"Viudo(a) / Widowed",value:"Viudo(a)"}]},{placeholder:"Profesión u ocupación, y posición / Profession or job, and position",type:"text",name:"profesion_ocupacion"},{placeholder:"Institución o empresa / Institution or company",type:"text",name:"institution"},{placeholder:"Dirección personal / Personal address - Ej.: 25 NW 72 ST, CP 37345, Orlando, Florida",type:"text",name:"address"},{placeholder:"Tipo de visa a solicitar / Visa type",type:"text",name:"visa_type",select:[{label:"Seleccionar / Select",value:""},{label:"Transeúnte familiar / Family Visitor",value:"Transeunte familiar"},{label:"Turista / Tourist",value:"Turista"},{label:"Transeúnte de negocios / Business Visitor",value:"Transeunte de negocios"},{label:"Transeúnte laboral / Worker Visitor",value:"Transeunte laboral"},{label:"Transeúnte inversionista / Investor Visitor",value:"Transeunte inversionista"},{label:"Transeúnte religioso / Religious Visitor",value:"Transeunte religioso"},{label:"Transeúnte estudiante / Student Visitor",value:"Transeunte estudiante"},{label:"Transeúnte de reingreso / Returning Visitor",value:"Transeunte de reingreso"},{label:"Transeúnte empresario industrial / Industrial Entrepreneur Visitor",value:"Transeunte empresario industrial"},{label:"Transeúnte rentista / Renter Visitor",value:"Transeunte rentista"},{label:"Transeúnte empleado doméstico / Domestic Employee Visitor",value:"Transeunte empleado domestico"},{label:"Transeúnte de tránsito / Transit Visitor",value:"Transeunte de tránsito"},{label:"Transeúnte familiar migrante permanente / Permanent Migrant Family Visitor",value:"Transeunte familiar migrante permanente"}]},{placeholder:"Lugar de alojamiento en Venezuela (Ser específico) / Place of accommodation address in Venezzuela (Please provide details)",type:"text",name:"alojamiento"},{placeholder:"Tiempo de la estadía en Venezuela / Length of stay in Venezuela",type:"text",name:"length_venezuela"},{placeholder:"Datos del familiar o conocido en Venezuela (nombres y apellidos, documentos de identidad y lugar de residencia) / Relative or acquaintance information in Venezuela (full name, identification documents, and place of residence)",type:"text",name:"family_venezuela"},{placeholder:"Motivo del viaje (Ser específico) / Reason for Travel (Please provide details)",type:"text",name:"motivo_viaje"},{placeholder:"Cuantas personas viajan con el solicitante? / How many people are traveling with the applicant?",type:"text",name:"how_many",select:[{label:"Seleccionar / Select",value:""},{label:"0",value:"0"},{label:"1",value:"1"},{label:"2",value:"2"},{label:"3",value:"3"},{label:"4",value:"4"},{label:"5",value:"5"},{label:"6",value:"6"},{label:"7",value:"7"},{label:"8",value:"8"},{label:"+9",value:"+9"}]},{placeholder:"Paises que ha visitado los ultimos 5 años (Ser específico) / Countries visited in the last 5 years (Please provide details)",type:"text",name:"last_5"},{placeholder:"Ha visitado Venezuela anteriormente? / Have you visited Venezuela before?",type:"text",name:"venezuela_previous",select:[{label:"Seleccionar / Select",value:""},{label:"SI / YES",value:"SI"},{label:"NO",value:"NO"}]},{placeholder:"Teléfono / Phone number - Ej.: +1 7869656708",type:"text",name:"personal_phone"},{placeholder:"Correo electrónico / Email - Ej.: tucorreo@embajada.com",type:"email",name:"correo_electronico"}]},Mz="/assets/ejemplo_pasaje-dM7azTXF.jpg",Lz={airtable:{base:"appzfvdMnCUnpQeq8",tabla:"salvoconducto_vzla"},nna:!0,dropbox:{folder:"salvoconducto_vzla"},files:[{title:"Foto fondo blanco",actionButton:"Subir imagen",file:mh,accept:".jpg",name:"foto"},{title:"Documento de identidad del solicitante (Cédula, Pasaporte o Acta de Nacimiento)",actionButton:"Subir documento",file:ck,accept:".jpg",name:"documento_identidad_solicitante"},{title:"Foto de pasaje con destino a Venezuela",actionButton:"Subir pasaje",file:Mz,accept:".jpg",name:"pasaje_solicitante"}],form:`
DOCUMENTO DE VIAJE / TRAVEL DOCUMENT N° {{slug}}
Lugar y fecha de emisión / Place and date of issuance Válido hasta / Valid until
México, {{date}} {{fecha_viaje_venezuela}}

La Embajada de la República Bolivariana de Venezuela en México, expide el presente DOCUMENTO DE VIAJE a la persona de nacionalidad venezolana indicada a continuación: / The Embassy of the Bolivarian Republic of Venezuela in México, issues this TRAVEL DOCUMENT to the person of Venezuelan nationality indicated below:

DATOS PERSONALES / PERSONAL DATA
Apellidos / Surname {{primer_apellido}} {{segundo_apellido}}
Nombres / Given names {{primer_nombre}} {{segundo_nombre}}
Lugar de nacimiento / Birthplace {{estado_nacimiento}}
Fecha de nacimiento (D-M-A) / Birth date (D-M-Y) {{fecha_nacimiento}}
Sexo / Gender {{sexo}}
Nacionalidad / Citizenship {{nacionalidad}}
Número de cédula de identidad / Venezuelan ID number {{cedula}}
Rostro / Face shape {{rostro}}
Color de los ojos / Color of eyes {{ojos}}
Color del cabello / Color of hair {{pelo}}
Señas particulares / Distinctive features NINGUNA
Motivo de la emisión / Reason for issuance RETORNO VOLUNTARIO

El presente DOCUMENTO DE VIAJE solamente tendrá validez para viajar con destino a la República Bolivariana de Venezuela, de acuerdo con el itinerario especificado a continuación: / This TRAVEL DOCUMENT will only be valid for travel to the Bolivarian Republic of Venezuela, in acordance with the itinerary specified below:

Itinerario / Itinerary
Vuelo / Flight Origen / Origin Destino / Destination Fecha / Date Horarios / Schedule
{{aerolinea_retorno}} {{numero_vuelo_ida}} {{aeropuerto_salida}} {{aeropuerto_entrada}} {{fecha_viaje_venezuela_flight}} {{hora_llegada}}
`,instructive:`

El salvoconducto es un documento provisional que permita al (la) solicitante que no posee un pasaporte vigente (pasporte vencido, cédula de identidad o acta de nacimiento), poder viajar desde los Estados Unidos Mexicanos o cualquier otro país de residencia hacia la República Bolivariana de Venezuela, con la adquisición de un boleto aéreo de alguna de las líneas que ofrecen esa ruta.

El objetivo es proporcionar un documento de identidad provisional al ciudadano(a) de nacionalidad venezolana quien porta un documento de identificación (cédula de identidad, pasaporte, y/o acta de nacimiento) físico vencido, extraviado o deteriorado.

Requisitos Mayores de Edad:
- Pago del arancel consular de $60 USD.
- Llenar en línea la solicitud en: tramitesconsularesvenmex.com/salvoconducto-vzla
- Adjuntar foto personal (fondo blanco) en formato JPG (sin gorra, sin lentes, con cabello recogido)
- Adjuntar el documento de identidad que acredite la nacionalidad venezolana en formato JPG
- Adjuntar reserva del pasaje aéreo en formato JPG

Niño, Niña o Adolescente:
- Exento de pago.
- Llenar en línea la solicitud en: tramitesconsularesvenmex.com/salvoconducto-vzla
- Adjuntar foto personal (fondo blanco) en formato JPG (sin gorra, sin lentes, con cabello recogido)
- Adjuntar el documento de identidad que acredite la nacionalidad venezolana en formato JPG
- Adjuntar reserva del pasaje aéreo en formato JPG

Consideraciones importantes - Para realizar este trámite, necesita una cédula de identidad venezolana, un pasaporte venezolano o un acta de nacimiento venezolana. Además, debe presentar un boleto aéreo con fecha de vuelo al menos 7 días posterior a la fecha en que realice el trámite.
- Si el pago va a realizarlo en la sede de la Sección Consular de la Embajada de la República Bolivariana de Venezuela, este debe ser en efectivo en USD.
- Debe solicitar el código con el que podrá tener acceso a la forma (Adulto - Mayor de edad).
- El destino final solo puede ser a un aeropuerto del territorio nacional venezolano.
- Una vez llenado los datos, adjuntado los documentos solicitados y enviado la información deberá recibir el salvoconducto en el correo electrónico suministrado 48 horas previas a su vuelo.

La Embajada no se hace responsable de ningún perjuicio económico, incluida la pérdida de pagos, en caso de que las autoridades migratorias detecten errores o datos incompletos en la solicitud. La veracidad de la información proporcionada es responsabilidad exclusiva del solicitante.

`,subtitle:"Salvoconducto a Venezuela",title:"Forma SAV",values:[{placeholder:"Número de planilla de pago",type:"text",name:"numero_planilla",nna:"adult"},{placeholder:"País de residencia en los últimos 30 días",type:"text",name:"pais_residencia_ultimos_dias",select:[{label:"Seleccionar",value:""},{label:"México",value:"Estados Unidos Mexicanos"},{label:"Argentina",value:"Argentina"},{label:"Canadá",value:"Canadá"},{label:"Chile",value:"Chile"},{label:"Costa Rica",value:"Costa Rica"},{label:"Ecuador",value:"Ecuador"},{label:"El Salvador",value:"El Salvador"},{label:"Estados Unidos de América",value:"Estados Unidos de América"},{label:"Guatemala",value:"Guatemala"},{label:"Honduras",value:"Honduras"},{label:"Jamaica",value:"Jamaica"},{label:"Panamá",value:"Panamá"},{label:"Perú",value:"Perú"},{label:"República Dominicana",value:"República Dominicana"},{label:"Uruguay",value:"Uruguay"}],nna:"both"},{placeholder:"Primer Nombre",type:"text",name:"primer_nombre",nna:"both"},{placeholder:"Segundo Nombre",type:"text",name:"segundo_nombre",apply:!0,nna:"both"},{placeholder:"Primer Apellido",type:"text",name:"primer_apellido",nna:"both"},{placeholder:"Segundo Apellido",type:"text",name:"segundo_apellido",apply:!0,nna:"both"},{placeholder:"Número de cédula. Ej.: 20440100",type:"text",name:"cedula",apply:!0,nna:"both"},{placeholder:"Número de pasaporte Ej.: 123456789",type:"text",name:"pasaporte",apply:!0,nna:"both"},{placeholder:"Fecha de Nacimiento",type:"date",name:"fecha_nacimiento",nna:"both"},{placeholder:"Estado de nacimiento",type:"text",name:"estado_nacimiento",select:[{label:"Seleccionar",value:""},{label:"Extranjero de Madre y/o Padre Venezolano",value:"Extranjero de Madre y/o Padre Venezolano"},{label:"Amazonas",value:"Amazonas"},{label:"Anzoátegui",value:"Anzoátegui"},{label:"Apure",value:"Apure"},{label:"Aragua",value:"Aragua"},{label:"Barinas",value:"Barinas"},{label:"Bolívar",value:"Bolívar"},{label:"Carabobo",value:"Carabobo"},{label:"Cojedes",value:"Cojedes"},{label:"Delta Amacuro",value:"Delta Amacuro"},{label:"Distrito Capital",value:"Distrito Capital"},{label:"Falcón",value:"Falcón"},{label:"Guárico",value:"Guárico"},{label:"Lara",value:"Lara"},{label:"La Guaira",value:"La Guaira"},{label:"Mérida",value:"Mérida"},{label:"Miranda",value:"Miranda"},{label:"Monagas",value:"Monagas"},{label:"Nueva Esparta",value:"Nueva Esparta"},{label:"Portuguesa",value:"Portuguesa"},{label:"Sucre",value:"Sucre"},{label:"Táchira",value:"Táchira"},{label:"Trujillo",value:"Trujillo"},{label:"Yaracuy",value:"Yaracuy"},{label:"Zulia",value:"Zulia"}],nna:"both"},{placeholder:"Ciudad de nacimiento",type:"text",name:"ciudad_nacimiento",select:[{estado:"Amazonas",ciudades:[{label:"Seleccionar",value:""},{label:"La Esmeralda (Alto Orinoco)",value:"La Esmeralda (Alto Orinoco)"},{label:"San Fernando de Atabapo (Atabapo)",value:"San Fernando de Atabapo (Atabapo)"},{label:"Puerto Ayacucho (Atures)",value:"Puerto Ayacucho (Atures)"},{label:"Isla Ratón (Autana)",value:"Isla Ratón (Autana)"},{label:"San Juan de Manapiare (Manapiare)",value:"San Juan de Manapiare (Manapiare)"},{label:"Maroa (Maroa)",value:"Maroa (Maroa)"},{label:"San Carlos de Río Negro (Río Negro)",value:"San Carlos de Río Negro (Río Negro)"}]},{estado:"Anzoátegui",ciudades:[{label:"Seleccionar",value:""},{label:"Anaco (Anaco)",value:"Anaco (Anaco)"},{label:"Aragua de Barcelona (Aragua)",value:"Aragua de Barcelona (Aragua)"},{label:"Barcelona (Bolívar)",value:"Barcelona (Bolívar)"},{label:"Clarines (Bruzual)",value:"Clarines (Bruzual)"},{label:"Onoto (Cajigal)",value:"Onoto (Cajigal)"},{label:"Valle de Guanape (Carvajal)",value:"Valle de Guanape (Carvajal)"},{label:"Cantaura (Freites)",value:"Cantaura (Freites)"},{label:"San José de Guanipa (Guanipa)",value:"San José de Guanipa (Guanipa)"},{label:"Guanta (Guanta)",value:"Guanta (Guanta)"},{label:"Soledad (Independencia)",value:"Soledad (Independencia)"},{label:"San Mateo (Libertad)",value:"San Mateo (Libertad)"},{label:"El Chaparro (Sir Arthur McGregor)",value:"El Chaparro (Sir Arthur McGregor)"},{label:"Pariaguán (Miranda)",value:"Pariaguán (Miranda)"},{label:"Mapire (Monagas)",value:"Mapire (Monagas)"},{label:"Puerto Píritu (Peñalver)",value:"Puerto Píritu (Peñalver)"},{label:"Píritu (Píritu)",value:"Píritu (Píritu)"},{label:"Boca de Uchire (San Juan de Capistrano)",value:"Boca de Uchire (San Juan de Capistrano)"},{label:"Santa Ana (Santa Ana)",value:"Santa Ana (Santa Ana)"},{label:"El Tigre (Simón Rodríguez)",value:"El Tigre (Simón Rodríguez)"},{label:"Puerto La Cruz (Sotillo)",value:"Puerto La Cruz (Sotillo)"},{label:"Lechería (Turístico Diego Bautista Urbaneja)",value:"Lechería (Turístico Diego Bautista Urbaneja)"}]},{estado:"Apure",ciudades:[{label:"Seleccionar",value:""},{label:"Achaguas (Achaguas)",value:"Achaguas (Achaguas)"},{label:"Biruaca (Biruaca)",value:"Biruaca (Biruaca)"},{label:"San Juan de Payara (Pedro Camejo)",value:"San Juan de Payara (Pedro Camejo)"},{label:"Bruzual (Muñoz)",value:"Bruzual (Muñoz)"},{label:"Guasdualito (Páez)",value:"Guasdualito (Páez)"},{label:"Elorza (Rómulo Gallegos)",value:"Elorza (Rómulo Gallegos)"},{label:"San Fernando de Apure (San Fernando)",value:"San Fernando de Apure (San Fernando)"}]},{estado:"Aragua",ciudades:[{label:"Seleccionar",value:""},{label:"Santa Rita (Alcántara)",value:"Santa Rita (Alcántara)"},{label:"San Mateo (Bolívar)",value:"San Mateo (Bolívar)"},{label:"Camatagua (Camatagua)",value:"Camatagua (Camatagua)"},{label:"Maracay (Girardot)",value:"Maracay (Girardot)"},{label:"El Limón (Iragorry)",value:"El Limón (Iragorry)"},{label:"Santa Cruz de Aragua (Lamas)",value:"Santa Cruz de Aragua (Lamas)"},{label:"Palo Negro (Libertador)",value:"Palo Negro (Libertador)"},{label:"Turmero (Mariño)",value:"Turmero (Mariño)"},{label:"Las Tejerías (Michelena)",value:"Las Tejerías (Michelena)"},{label:"Ocumare de la Costa (Ocumare de la Costa de Oro)",value:"Ocumare de la Costa (Ocumare de la Costa de Oro)"},{label:"El Consejo (Revenga)",value:"El Consejo (Revenga)"},{label:"La Victoria (Ribas)",value:"La Victoria (Ribas)"},{label:"San Casimiro (San Casimiro)",value:"San Casimiro (San Casimiro)"},{label:"San Sebastián de los Reyes (San Sebastián)",value:"San Sebastián de los Reyes (San Sebastián)"},{label:"Cagua (Sucre)",value:"Cagua (Sucre)"},{label:"Colonia Tovar (Tovar)",value:"Colonia Tovar (Tovar)"},{label:"Barbacoas (Urdaneta)",value:"Barbacoas (Urdaneta)"},{label:"Villa de Cura (Zamora)",value:"Villa de Cura (Zamora)"}]},{estado:"Barinas",ciudades:[{label:"Seleccionar",value:""},{label:"Sabaneta (Alberto Arvelo Torrealba)",value:"Sabaneta (Alberto Arvelo Torrealba)"},{label:"El Cantón (Andrés Eloy Blanco)",value:"El Cantón (Andrés Eloy Blanco)"},{label:"Socopó (Antonio José de Sucre)",value:"Socopó (Antonio José de Sucre)"},{label:"Arismendi (Arismendi)",value:"Arismendi (Arismendi)"},{label:"Barinas (Barinas)",value:"Barinas (Barinas)"},{label:"Barinitas (Bolívar)",value:"Barinitas (Bolívar)"},{label:"Barrancas (Cruz Paredes)",value:"Barrancas (Cruz Paredes)"},{label:"Santa Bárbara (Ezequiel Zamora)",value:"Santa Bárbara (Ezequiel Zamora)"},{label:"Obispos (Obispos)",value:"Obispos (Obispos)"},{label:"Ciudad Bolivia (Pedraza)",value:"Ciudad Bolivia (Pedraza)"},{label:"Libertad (Rojas)",value:"Libertad (Rojas)"},{label:"Ciudad de Nutrias (Sosa)",value:"Ciudad de Nutrias (Sosa)"}]},{estado:"Bolívar",ciudades:[{label:"Seleccionar",value:""},{label:"Ciudad Piar (Angostura)",value:"Ciudad Piar (Angostura)"},{label:"Ciudad Bolívar (Angostura del Orinoco)",value:"Ciudad Bolívar (Angostura del Orinoco)"},{label:"Ciudad Guayana (Caroní)",value:"Ciudad Guayana (Caroní)"},{label:"Caicara del Orinoco (Cedeño)",value:"Caicara del Orinoco (Cedeño)"},{label:"El Palmar (Chien)",value:"El Palmar (Chien)"},{label:"El Callao (El Callao)",value:"El Callao (El Callao)"},{label:"Santa Elena de Uairén (Gran Sabana)",value:"Santa Elena de Uairén (Gran Sabana)"},{label:"Upata (Piar)",value:"Upata (Piar)"},{label:"Guasipati (Roscio)",value:"Guasipati (Roscio)"},{label:"El Dorado (Sifontes)",value:"El Dorado (Sifontes)"},{label:"Maripa (Sucre)",value:"Maripa (Sucre)"}]},{estado:"Carabobo",ciudades:[{label:"Seleccionar",value:""},{label:"Bejuma (Bejuma)",value:"Bejuma (Bejuma)"},{label:"Güigüe (Carlos Arvelo)",value:"Güigüe (Carlos Arvelo)"},{label:"Mariara (Diego Ibarra)",value:"Mariara (Diego Ibarra)"},{label:"Guacara (Guacara)",value:"Guacara (Guacara)"},{label:"Morón (Juan José Mora)",value:"Morón (Juan José Mora)"},{label:"Tocuyito (Libertador)",value:"Tocuyito (Libertador)"},{label:"Los Guayos (Los Guayos)",value:"Los Guayos (Los Guayos)"},{label:"Miranda (Miranda)",value:"Miranda (Miranda)"},{label:"Montalbán (Montalbán)",value:"Montalbán (Montalbán)"},{label:"Naguanagua (Naguanagua)",value:"Naguanagua (Naguanagua)"},{label:"Puerto Cabello (Puerto Cabello)",value:"Puerto Cabello (Puerto Cabello)"},{label:"San Diego (San Diego)",value:"San Diego (San Diego)"},{label:"San Joaquín (San Joaquín)",value:"San Joaquín (San Joaquín)"},{label:"Valencia (Valencia)",value:"Valencia (Valencia)"}]},{estado:"Cojedes",ciudades:[{label:"Seleccionar",value:""},{label:"Cojedes (Anzoátegui)",value:"Cojedes (Anzoátegui)"},{label:"San Carlos (San Carlos)",value:"San Carlos (San Carlos)"},{label:"El Baúl (Girardot)",value:"El Baúl (Girardot)"},{label:"Macapo (Lima Blanco)",value:"Macapo (Lima Blanco)"},{label:"El Pao (Pao de San Juan Bautista)",value:"El Pao (Pao de San Juan Bautista)"},{label:"Libertad (Ricaurte)",value:"Libertad (Ricaurte)"},{label:"Las Vegas (Rómulo Gallegos)",value:"Las Vegas (Rómulo Gallegos)"},{label:"Tinaco (Tinaco)",value:"Tinaco (Tinaco)"},{label:"Tinaquillo (Tinaquillo)",value:"Tinaquillo (Tinaquillo)"}]},{estado:"Delta Amacuro",ciudades:[{label:"Seleccionar",value:""},{label:"Curiapo (Antonio Díaz)",value:"Curiapo (Antonio Díaz)"},{label:"Sierra Imataca (Casacoima)",value:"Sierra Imataca (Casacoima)"},{label:"Pedernales (Pedernales)",value:"Pedernales (Pedernales)"},{label:"Tucupita (Tucupita)",value:"Tucupita (Tucupita)"}]},{estado:"Distrito Capital",ciudades:[{label:"Seleccionar",value:""},{label:"Caracas (Libertador)",value:"Caracas (Libertador)"}]},{estado:"Falcón",ciudades:[{label:"Seleccionar",value:""},{label:"San Juan de los Cayos (Acosta)",value:"San Juan de los Cayos (Acosta)"},{label:"San Luis (Bolívar)",value:"San Luis (Bolívar)"},{label:"Capatárida (Buchivacoa)",value:"Capatárida (Buchivacoa)"},{label:"Punto Fijo (Carirubana)",value:"Punto Fijo (Carirubana)"},{label:"La Vela de Coro (Colina)",value:"La Vela de Coro (Colina)"},{label:"Dabajuro (Dabajuro)",value:"Dabajuro (Dabajuro)"},{label:"Pedregal (Democracia)",value:"Pedregal (Democracia)"},{label:"Pueblo Nuevo (Falcón)",value:"Pueblo Nuevo (Falcón)"},{label:"Churuguara (Federación)",value:"Churuguara (Federación)"},{label:"Chichiriviche (Iturriza)",value:"Chichiriviche (Iturriza)"},{label:"Jacura (Jacura)",value:"Jacura (Jacura)"},{label:"Santa Cruz de Los Taques (Los Taques)",value:"Santa Cruz de Los Taques (Los Taques)"},{label:"Yaracal (Manaure)",value:"Yaracal (Manaure)"},{label:"Mene de Mauroa (Mauroa)",value:"Mene de Mauroa (Mauroa)"},{label:"Santa Ana de Coro (Miranda)",value:"Santa Ana de Coro (Miranda)"},{label:"Palmasola (Palmasola)",value:"Palmasola (Palmasola)"},{label:"Cabure (Petit)",value:"Cabure (Petit)"},{label:"Píritu (Píritu)",value:"Píritu (Píritu)"},{label:"Mirimire (San Francisco)",value:"Mirimire (San Francisco)"},{label:"La Cruz de Taratara (Sucre)",value:"La Cruz de Taratara (Sucre)"},{label:"Tucacas (Silva)",value:"Tucacas (Silva)"},{label:"Tocópero (Tocópero)",value:"Tocópero (Tocópero)"},{label:"Santa Cruz de Bucaral (Unión)",value:"Santa Cruz de Bucaral (Unión)"},{label:"Urumaco (Urumaco)",value:"Urumaco (Urumaco)"},{label:"Puerto Cumarebo (Zamora)",value:"Puerto Cumarebo (Zamora)"}]},{estado:"Guárico",ciudades:[{label:"Seleccionar",value:""},{label:"Camaguán (Camaguán)",value:"Camaguán (Camaguán)"},{label:"Chaguaramas (Chaguaramas)",value:"Chaguaramas (Chaguaramas)"},{label:"El Socorro (El Socorro)",value:"El Socorro (El Socorro)"},{label:"Calabozo (Francisco de Miranda)",value:"Calabozo (Francisco de Miranda)"},{label:"Tucupido (José Félix Ribas)",value:"Tucupido (José Félix Ribas)"},{label:"Altagracia de Orituco (José Tadeo Monagas)",value:"Altagracia de Orituco (José Tadeo Monagas)"},{label:"San Juan de los Morros (Juan Germán Roscio)",value:"San Juan de los Morros (Juan Germán Roscio)"},{label:"Las Mercedes (Juan José Rondón)",value:"Las Mercedes (Juan José Rondón)"},{label:"El Sombrero (Julián Mellado)",value:"El Sombrero (Julián Mellado)"},{label:"Valle de La Pascua (Leonardo Infante)",value:"Valle de La Pascua (Leonardo Infante)"},{label:"Ortiz (Ortiz)",value:"Ortiz (Ortiz)"},{label:"Guayabal (San Gerónimo de Guayabal)",value:"Guayabal (San Gerónimo de Guayabal)"},{label:"San José de Guaribe (San José de Guaribe)",value:"San José de Guaribe (San José de Guaribe)"},{label:"Santa María de Ipire (Santa María de Ipire)",value:"Santa María de Ipire (Santa María de Ipire)"},{label:"Zaraza (Zaraza)",value:"Zaraza (Zaraza)"}]},{estado:"Lara",ciudades:[{label:"Seleccionar",value:""},{label:"Sanare (Andrés Eloy Blanco)",value:"Sanare (Andrés Eloy Blanco)"},{label:"Duaca (Crespo)",value:"Duaca (Crespo)"},{label:"Barquisimeto (Iribarren)",value:"Barquisimeto (Iribarren)"},{label:"Quibor (Jiménez)",value:"Quibor (Jiménez)"},{label:"El Tocuyo (Morán)",value:"El Tocuyo (Morán)"},{label:"Cabudare (Palavecino)",value:"Cabudare (Palavecino)"},{label:"Sarare (Simón Planas)",value:"Sarare (Simón Planas)"},{label:"Carora (Torres)",value:"Carora (Torres)"},{label:"Siquisique (Urdaneta)",value:"Siquisique (Urdaneta)"},{label:"La Guaira (Vargas)",value:"La Guaira (Vargas)"}]},{estado:"La Guaira",ciudades:[{label:"Seleccionar",value:""},{label:"La Guaira",value:"La Guaira"},{label:"Caraballeda",value:"Caraballeda"},{label:"Carayaca",value:"Carayaca"},{label:"Naiguatá",value:"Naiguatá"},{label:"Macuto",value:"Macuto"},{label:"Maiquetía",value:"Maiquetía"},{label:"Táriba",value:"Táriba"}]},{estado:"Mérida",ciudades:[{label:"Seleccionar",value:""},{label:"El Vigía (Alberto Adriani)",value:"El Vigía (Alberto Adriani)"},{label:"La Azulita (Andrés Bello)",value:"La Azulita (Andrés Bello)"},{label:"Santa Cruz de Mora (Antonio Pinto Salinas)",value:"Santa Cruz de Mora (Antonio Pinto Salinas)"},{label:"Aricagua (Aricagua)",value:"Aricagua (Aricagua)"},{label:"Canaguá (Arzobispo Chacón)",value:"Canaguá (Arzobispo Chacón)"},{label:"Ejido (Campo Elías)",value:"Ejido (Campo Elías)"},{label:"Tucaní (Caracciolo Parra Olmedo)",value:"Tucaní (Caracciolo Parra Olmedo)"},{label:"Santo Domingo (Cardenal Quintero)",value:"Santo Domingo (Cardenal Quintero)"},{label:"Guaraque (Guaraque)",value:"Guaraque (Guaraque)"},{label:"Arapuey (Julio Cesar Salas)",value:"Arapuey (Julio Cesar Salas)"},{label:"Torondoy (Justo Briceño)",value:"Torondoy (Justo Briceño)"},{label:"Mérida (Libertador)",value:"Mérida (Libertador)"},{label:"Timotes (Miranda)",value:"Timotes (Miranda)"},{label:"Santa Elena de Arenales (Obispo Ramos de Lora)",value:"Santa Elena de Arenales (Obispo Ramos de Lora)"},{label:"Santa María de Caparo (Padre Noguera)",value:"Santa María de Caparo (Padre Noguera)"},{label:"Pueblo Llano (Pueblo Llano)",value:"Pueblo Llano (Pueblo Llano)"},{label:"Mucuchíes (Rangel)",value:"Mucuchíes (Rangel)"},{label:"Bailadores (Rivas Dávila)",value:"Bailadores (Rivas Dávila)"},{label:"Tabay (Santos Marquina)",value:"Tabay (Santos Marquina)"},{label:"Lagunillas (Sucre)",value:"Lagunillas (Sucre)"},{label:"Tovar (Tovar)",value:"Tovar (Tovar)"},{label:"Nueva Bolivia (Tulio Febres Cordero)",value:"Nueva Bolivia (Tulio Febres Cordero)"},{label:"Zea (Zea)",value:"Zea (Zea)"}]},{estado:"Miranda",ciudades:[{label:"Seleccionar",value:""},{label:"Caucagua (Acevedo)",value:"Caucagua (Acevedo)"},{label:"San José de Barlovento (Andrés Bello)",value:"San José de Barlovento (Andrés Bello)"},{label:"Baruta (Baruta)",value:"Baruta (Baruta)"},{label:"San Francisco de Yare (Bolívar)",value:"San Francisco de Yare (Bolívar)"},{label:"Higuerote (Brión)",value:"Higuerote (Brión)"},{label:"Mamporal (Buroz)",value:"Mamporal (Buroz)"},{label:"Carrizal (Carrizal)",value:"Carrizal (Carrizal)"},{label:"Chacao (Chacao)",value:"Chacao (Chacao)"},{label:"Charallave (Cristóbal Rojas)",value:"Charallave (Cristóbal Rojas)"},{label:"El Hatillo (El Hatillo)",value:"El Hatillo (El Hatillo)"},{label:"Los Teques (Guaicaipuro)",value:"Los Teques (Guaicaipuro)"},{label:"El Jarillo (Guaicaipuro)",value:"El Jarillo (Guaicaipuro)"},{label:"Cúpira (Gual)",value:"Cúpira (Gual)"},{label:"Santa Teresa del Tuy (Independencia)",value:"Santa Teresa del Tuy (Independencia)"},{label:"Ocumare del Tuy (Lander)",value:"Ocumare del Tuy (Lander)"},{label:"San Antonio de los Altos (Los Salias)",value:"San Antonio de los Altos (Los Salias)"},{label:"Río Chico (Páez)",value:"Río Chico (Páez)"},{label:"Santa Lucía (Paz Castillo)",value:"Santa Lucía (Paz Castillo)"},{label:"Guarenas (Plaza)",value:"Guarenas (Plaza)"},{label:"Petare (Sucre)",value:"Petare (Sucre)"},{label:"Cúa (Urdaneta)",value:"Cúa (Urdaneta)"},{label:"Guatire (Zamora)",value:"Guatire (Zamora)"}]},{estado:"Monagas",ciudades:[{label:"Seleccionar",value:""},{label:"San Antonio de Capayacuar (Acosta)",value:"San Antonio de Capayacuar (Acosta)"},{label:"Aguasay (Aguasay)",value:"Aguasay (Aguasay)"},{label:"Caripito (Bolívar)",value:"Caripito (Bolívar)"},{label:"Caripe (Caripe)",value:"Caripe (Caripe)"},{label:"Caicara de Maturín (Cedeño)",value:"Caicara de Maturín (Cedeño)"},{label:"Temblador (Libertador)",value:"Temblador (Libertador)"},{label:"Maturín (Maturín)",value:"Maturín (Maturín)"},{label:"Aragua de Maturín (Piar)",value:"Aragua de Maturín (Piar)"},{label:"Quiriquire (Punceres)",value:"Quiriquire (Punceres)"},{label:"Santa Bárbara (Santa Bárbara)",value:"Santa Bárbara (Santa Bárbara)"},{label:"Barrancas del Orinoco (Sotillo)",value:"Barrancas del Orinoco (Sotillo)"},{label:"Uracoa (Uracoa)",value:"Uracoa (Uracoa)"},{label:"Punta de Mata (Zamora)",value:"Punta de Mata (Zamora)"}]},{estado:"Nueva Esparta",ciudades:[{label:"Seleccionar",value:""},{label:"La Plaza de Paraguachí (Antolín del Campo)",value:"La Plaza de Paraguachí (Antolín del Campo)"},{label:"San Juan Bautista (Antonio Díaz)",value:"San Juan Bautista (Antonio Díaz)"},{label:"La Asunción (Arismendi)",value:"La Asunción (Arismendi)"},{label:"El Valle (García)",value:"El Valle (García)"},{label:"Santa Ana (Gómez)",value:"Santa Ana (Gómez)"},{label:"Boca de Río (Macanao)",value:"Boca de Río (Macanao)"},{label:"Pampatar (Maneiro)",value:"Pampatar (Maneiro)"},{label:"Juan Griego (Marcano)",value:"Juan Griego (Marcano)"},{label:"Porlamar (Mariño)",value:"Porlamar (Mariño)"},{label:"Punta de Piedras (Tubores)",value:"Punta de Piedras (Tubores)"},{label:"San Pedro de Coche (Villalba)",value:"San Pedro de Coche (Villalba)"}]},{estado:"Portuguesa",ciudades:[{label:"Seleccionar",value:""},{label:"Agua Blanca (Agua Blanca)",value:"Agua Blanca (Agua Blanca)"},{label:"Araure (Araure)",value:"Araure (Araure)"},{label:"Píritu (Esteller)",value:"Píritu (Esteller)"},{label:"Guanare (Guanare)",value:"Guanare (Guanare)"},{label:"Guanarito (Guanarito)",value:"Guanarito (Guanarito)"},{label:"Chabasquén (José Vicente de Unda)",value:"Chabasquén (José Vicente de Unda)"},{label:"Ospino (Ospino)",value:"Ospino (Ospino)"},{label:"Acarigua (Páez)",value:"Acarigua (Páez)"},{label:"Papelón (Papelón)",value:"Papelón (Papelón)"},{label:"Boconoíto (San Genaro de Boconoíto)",value:"Boconoíto (San Genaro de Boconoíto)"},{label:"San Rafael de Onoto (San Rafael de Onoto)",value:"San Rafael de Onoto (San Rafael de Onoto)"},{label:"El Playón (Santa Rosalía)",value:"El Playón (Santa Rosalía)"},{label:"Biscucuy (Sucre)",value:"Biscucuy (Sucre)"},{label:"Villa Bruzual (Turén)",value:"Villa Bruzual (Turén)"}]},{estado:"Sucre",ciudades:[{label:"Seleccionar",value:""},{label:"Casanay (Andrés Eloy Blanco)",value:"Casanay (Andrés Eloy Blanco)"},{label:"San José de Aerocuar (Andrés Mata)",value:"San José de Aerocuar (Andrés Mata)"},{label:"Río Caribe (Arismendi)",value:"Río Caribe (Arismendi)"},{label:"El Pilar (Benítez)",value:"El Pilar (Benítez)"},{label:"Carúpano (Bermúdez)",value:"Carúpano (Bermúdez)"},{label:"Marigüitar (Bolívar)",value:"Marigüitar (Bolívar)"},{label:"Yaguaraparo (Cajigal)",value:"Yaguaraparo (Cajigal)"},{label:"Araya (Cruz Salmerón Acosta)",value:"Araya (Cruz Salmerón Acosta)"},{label:"Tunapuy (Libertador)",value:"Tunapuy (Libertador)"},{label:"Irapa (Mariño)",value:"Irapa (Mariño)"},{label:"San Antonio del Golfo (Mejía)",value:"San Antonio del Golfo (Mejía)"},{label:"Cumanacoa (Montes)",value:"Cumanacoa (Montes)"},{label:"Cariaco (Ribero)",value:"Cariaco (Ribero)"},{label:"Cumaná (Sucre)",value:"Cumaná (Sucre)"},{label:"Güiria (Valdez)",value:"Güiria (Valdez)"}]},{estado:"Táchira",ciudades:[{label:"Seleccionar",value:""},{label:"Cordero (Andrés Bello)",value:"Cordero (Andrés Bello)"},{label:"Las Mesas (Antonio Rómulo Costa)",value:"Las Mesas (Antonio Rómulo Costa)"},{label:"Colón (Ayacucho)",value:"Colón (Ayacucho)"},{label:"San Antonio del Táchira (Bolívar)",value:"San Antonio del Táchira (Bolívar)"},{label:"Táriba (Cárdenas)",value:"Táriba (Cárdenas)"},{label:"Santa Ana de Táchira (Córdoba)",value:"Santa Ana de Táchira (Córdoba)"},{label:"San Rafael del Piñal (Fernández)",value:"San Rafael del Piñal (Fernández)"},{label:"San José de Bolívar (Francisco de Miranda)",value:"San José de Bolívar (Francisco de Miranda)"},{label:"La Fría (García de Hevia)",value:"La Fría (García de Hevia)"},{label:"Palmira (Guásimos)",value:"Palmira (Guásimos)"},{label:"Capacho Nuevo (Independencia)",value:"Capacho Nuevo (Independencia)"},{label:"La Grita (Jáuregui)",value:"La Grita (Jáuregui)"},{label:"El Cobre (José María Vargas)",value:"El Cobre (José María Vargas)"},{label:"Rubio (Junín)",value:"Rubio (Junín)"},{label:"Capacho Viejo (Libertad)",value:"Capacho Viejo (Libertad)"},{label:"Abejales (Libertador)",value:"Abejales (Libertador)"},{label:"Lobatera (Lobatera)",value:"Lobatera (Lobatera)"},{label:"Michelena (Michelena)",value:"Michelena (Michelena)"},{label:"Coloncito (Panamericano)",value:"Coloncito (Panamericano)"},{label:"Ureña (Pedro María Ureña)",value:"Ureña (Pedro María Ureña)"},{label:"Delicias (Rafael Urdaneta)",value:"Delicias (Rafael Urdaneta)"},{label:"La Tendida (Samuel Dario Maldonado)",value:"La Tendida (Samuel Dario Maldonado)"},{label:"San Cristóbal (San Cristóbal)",value:"San Cristóbal (San Cristóbal)"},{label:"Umuquena (San Judas Tadeo)",value:"Umuquena (San Judas Tadeo)"},{label:"Seboruco (Seboruco)",value:"Seboruco (Seboruco)"},{label:"San Simón (Simón Rodríguez)",value:"San Simón (Simón Rodríguez)"},{label:"Queniquea (Sucre)",value:"Queniquea (Sucre)"},{label:"San Josecito (Torbes)",value:"San Josecito (Torbes)"},{label:"Pregonero (Uribante)",value:"Pregonero (Uribante)"}]},{estado:"Trujillo",ciudades:[{label:"Seleccionar",value:""},{label:"Santa Isabel (Andrés Bello)",value:"Santa Isabel (Andrés Bello)"},{label:"Boconó (Boconó)",value:"Boconó (Boconó)"},{label:"Sabana Grande (Bolívar)",value:"Sabana Grande (Bolívar)"},{label:"Chejendé (Candelaria)",value:"Chejendé (Candelaria)"},{label:"Carache (Carache)",value:"Carache (Carache)"},{label:"Carvajal (Carvajal)",value:"Carvajal (Carvajal)"},{label:"Escuque (Escuque)",value:"Escuque (Escuque)"},{label:"Campo Elías (Juan Vicente Campo Elías)",value:"Campo Elías (Juan Vicente Campo Elías)"},{label:"Santa Apolonia (La Ceiba)",value:"Santa Apolonia (La Ceiba)"},{label:"El Paradero (Márquez Cañizales)",value:"El Paradero (Márquez Cañizales)"},{label:"El Dividive (Miranda)",value:"El Dividive (Miranda)"},{label:"Monte Carmelo (Monte Carmelo)",value:"Monte Carmelo (Monte Carmelo)"},{label:"Motatán (Motatán)",value:"Motatán (Motatán)"},{label:"Pampán (Pampán)",value:"Pampán (Pampán)"},{label:"Pampanito (Pampanito)",value:"Pampanito (Pampanito)"},{label:"Betijoque (Rangel)",value:"Betijoque (Rangel)"},{label:"Sabana de Mendoza (Sucre)",value:"Sabana de Mendoza (Sucre)"},{label:"Trujillo (Trujillo)",value:"Trujillo (Trujillo)"},{label:"La Quebrada (Urdaneta)",value:"La Quebrada (Urdaneta)"},{label:"Valera (Valera)",value:"Valera (Valera)"}]},{estado:"Yaracuy",ciudades:[{label:"Seleccionar",value:""},{label:"San Pablo (Arístides Bastidas)",value:"San Pablo (Arístides Bastidas)"},{label:"Aroa (Bolívar)",value:"Aroa (Bolívar)"},{label:"Chivacoa (Bruzual)",value:"Chivacoa (Bruzual)"},{label:"Cocorote (Cocorote)",value:"Cocorote (Cocorote)"},{label:"Independencia (Independencia)",value:"Independencia (Independencia)"},{label:"Sabana de Parra (José Antonio Páez)",value:"Sabana de Parra (José Antonio Páez)"},{label:"Boraure (La Trinidad)",value:"Boraure (La Trinidad)"},{label:"Yumare (Manuel Monge)",value:"Yumare (Manuel Monge)"},{label:"Nirgua (Nirgua)",value:"Nirgua (Nirgua)"},{label:"Yaritagua (Peña)",value:"Yaritagua (Peña)"},{label:"San Felipe (San Felipe)",value:"San Felipe (San Felipe)"},{label:"Guama (Sucre)",value:"Guama (Sucre)"},{label:"Urachiche (Urachiche)",value:"Urachiche (Urachiche)"},{label:"Farriar (Veroes)",value:"Farriar (Veroes)"}]},{estado:"Zulia",ciudades:[{label:"Seleccionar",value:""},{label:"El Toro (Almirante Padilla)",value:"El Toro (Almirante Padilla)"},{label:"San Timoteo (Baralt)",value:"San Timoteo (Baralt)"},{label:"Cabimas (Cabimas)",value:"Cabimas (Cabimas)"},{label:"Encontrados (Catatumbo)",value:"Encontrados (Catatumbo)"},{label:"San Carlos del Zulia (Colón)",value:"San Carlos del Zulia (Colón)"},{label:"Pueblo Nuevo-El Chivo (Francisco Javier Pulgar)",value:"Pueblo Nuevo-El Chivo (Francisco Javier Pulgar)"},{label:"Sinamaica (Guajira)",value:"Sinamaica (Guajira)"},{label:"La Concepción (Jesús Enrique Lossada)",value:"La Concepción (Jesús Enrique Lossada)"},{label:"Casigua El Cubo (Jesús María Semprún)",value:"Casigua El Cubo (Jesús María Semprún)"},{label:"Concepción (La Cañada de Urdaneta)",value:"Concepción (La Cañada de Urdaneta)"},{label:"Ciudad Ojeda (Lagunillas)",value:"Ciudad Ojeda (Lagunillas)"},{label:"Machiques (Machiques de Perijá)",value:"Machiques (Machiques de Perijá)"},{label:"San Rafael del Moján (Mara)",value:"San Rafael del Moján (Mara)"},{label:"Maracaibo (Maracaibo)",value:"Maracaibo (Maracaibo)"},{label:"Los Puertos de Altagracia (Miranda)",value:"Los Puertos de Altagracia (Miranda)"},{label:"La Villa del Rosario (Rosario de Perijá)",value:"La Villa del Rosario (Rosario de Perijá)"},{label:"San Francisco (San Francisco)",value:"San Francisco (San Francisco)"},{label:"Santa Rita (Santa Rita)",value:"Santa Rita (Santa Rita)"},{label:"Tía Juana (Simón Bolívar)",value:"Tía Juana (Simón Bolívar)"},{label:"Bobures (Sucre)",value:"Bobures (Sucre)"},{label:"Bachaquero (Valmore Rodríguez)",value:"Bachaquero (Valmore Rodríguez)"}]}],nna:"both"},{placeholder:"Sexo",type:"text",name:"sexo",select:[{label:"Seleccionar",value:""},{label:"Masculino",value:"Masculino"},{label:"Femenino",value:"Femenino"}],nna:"both"},{placeholder:"Domicilio en Venezuela (Sin abreviaturas) - Ej.: Calle 1, Avenida 1. Zulia, Maracaibo, Maracaibo, El Milagro",type:"text",name:"direccion_vzla",nna:"both"},{placeholder:"Fecha de viaje a Venezuela, 7 días posteriores a esta solicitud.",type:"date",name:"fecha_viaje_venezuela",nna:"both"},{placeholder:"Aeropuerto (SALIDA), en código IATA. - Ej.: MEX (Si tiene escala - Ej.: MEX / BOG)",type:"text",name:"aeropuerto_salida",nna:"both"},{placeholder:"Aeropuerto (ENTRADA), en código IATA - Ej.: CCS",type:"text",name:"aeropuerto_entrada",nna:"both"},{placeholder:"Número de vuelo. - Ej.: VB152 (Si tiene varios numeros de vuelo VB152 / VB156)",type:"text",name:"numero_vuelo_ida",nna:"both"},{placeholder:"Hora de llegada, solo vuelo a VZLA. - Ej.: 16:00",type:"text",name:"hora_llegada",nna:"both"},{placeholder:"Aerolínea - Ej.: Conviasa (Si tiene varias lineas aereas Conviasa / Laser)",type:"text",name:"aerolinea_retorno",nna:"both"},{placeholder:"Nombre completo del Papá",type:"text",name:"nombre_padre",nna:"nna"},{placeholder:"Nombre completo de la Mamá",type:"text",name:"nombre_madre",nna:"nna"},{placeholder:"Caracteristicas del rostro",type:"text",name:"rostro",select:[{label:"Seleccionar",value:""},{label:"Ovalado",value:"Ovalado"},{label:"Redondo",value:"Redondo"},{label:"Cuadrado",value:"Cuadrado"}],nna:"both"},{placeholder:"Color de ojos",type:"text",name:"ojos",select:[{label:"Seleccionar",value:""},{label:"Negro",value:"Negro"},{label:"Marrón",value:"Marrón"},{label:"Verde",value:"Verde"},{label:"Azul",value:"Azul"},{label:"Gris",value:"Gris"},{label:"Amarillo",value:"Amarillo"}],nna:"both"},{placeholder:"Color de cabello",type:"text",name:"pelo",select:[{label:"Seleccionar",value:""},{label:"Negro",value:"Negro"},{label:"Marrón",value:"Marrón"},{label:"Gris",value:"Gris"},{label:"Blanco",value:"Blanco"},{label:"Azul",value:"Azul"},{label:"Verde",value:"Verde"},{label:"Amarillo",value:"Amarillo"},{label:"Rojizo",value:"Rojizo"},{label:"Calvo",value:"Calvo"}],nna:"both"},{placeholder:"Teléfono de emergencia. - Ej.: +58 4126506000",type:"text",name:"telefono_emergencia",apply:!0,nna:"both"},{placeholder:"Teléfono en Vzla - Ej.: +58 4126506000",type:"text",name:"telefono"},{placeholder:"Correo electrónico - Ej.: tucorreo@embajada.com",type:"email",name:"correo_electronico",nna:"both"},{placeholder:"Documento de identificación presentado (En subir documento)",type:"text",name:"documento_identificación_presentado",select:[{label:"Seleccionar",value:""},{label:"Cédula de identidad",value:"Cédula de identidad"},{label:"Pasaporte",value:"Pasaporte"},{label:"Acta de nacimiento",value:"Acta de nacimiento"}],nna:"both"}]},Dz="/assets/fac_sign-C78OB6lm.svg",Fz="/assets/aera_sign-B2nvlIn-.svg",Bz="Schiller 326, Col. Chapultepec Morales, Del. Miguel Hidalgo. C.P. 11570, Mexico, D.F.",Uz="Cargando",Vz="Confirmando trámite",jz="El formato del email es inválido.",zz="logo embajada de venezuela en mexico",qz="Ejemplo",Gz="Registrar usuario",Hz="Enviar",Wz="Por favor espere, no cierre la ventana",$z="Su trámite esta en proceso.

En caso de encontrarse en la sede de la embajada puede retirar su trámite el mismo día.

En caso de que la solicitud no sea presencial recibirá respuesta del mismo en su correo electrónico de 24-48 horas.

Excepto en el caso de visas y/o salvoconductos, que requieren un proceso de revisión más extenso para su aprobación.",Kz="Se produjo un error, por favor escriba a: tramitesconsularesvenmex@gmail.com",Jz="Ir a inicio",Yz="Llenar forma",Xz="Instructivo",Qz="Este pasaporte ya esta registrado.",Zz="Nuevo Token",eq="Nuevos Tokens",tq="/login",dk="Cerrar sesión",nq="He leído todas las instrucciones, términos y condiciones.",rq="He llenado los campos requeridos, subido los archivos correspondientes y chequeado todos los datos.",aq="Confirmar código",iq="El código debe tener exactamente 6 dígitos",sq="El código debe contener solo números",oq="El código no existe",lq="El código ya fue utilizado",uq="Embajada de la República Bolivariana de Venezuela en México",cq="Enviar forma",XE="Página no encontrada",dq="No aplica",hq="Niño, Niña o Adolescente",fq="Su trámite no está exento de pago, debe entrar en la forma como: Adulto - Mayor de edad.",pq="Conviasa",mq="Email",gq="Documento",vq="Este documento no existe.",_q="Entrar",yq="Enviado",Pw="Enviar",Eq="Error en usuario o contraseña.",bq="Expediente",$g="Debe subir todos los archivos correspondientes.",xq="Firebase: Error (auth/invalid-credential).",hk="Debes completar todos los campos de la forma.",Sq="¡En mantenimiento!",Kg="N/A",Tq="No hay trámites pendientes 🇻🇪🇲🇽",wq="La contraseña debe tener al menos 6 caracteres.",Cq="Recuerde pagar la anualidad. El sistema vence el",Aq="Rechazado",Rw="Rechazar",Iq="rejected",Pq="sent",Rq="Se produjo un error en la carga de archivos, vuelve a registrarte.",kq="Validando",Nq="Boleto",Oq="Fecha de viaje invalida.",Mq='Ministerio del Poder Popular
para las Relaciones Exteriores',Lq=" Schiller 326, Col. Chapultepec Morales, Del. Miguel Hidalgo. C.P. 11570, México, D.F. Teléfonos: (0052) 5203 4233/5203 4435 FAX (0052) 5254 1457. Correo Electrónico: embve.mxmdf@mppre.gob.ve Página Web: http://mexico.embajada.gob.ve",Dq="FRANCISCO JAVIER ARIAS CÁRDENAS
EMBAJADOR",Fq="ANDRES ELOY RUIZ ADRIAN
MINISTRO CONSEJERO",Bq="Constancia que se expide en la Ciudad de México, el día",ym=[{base:"carta_identidad",match:"carta-identidad",id:"appXe9qo7ntzbEzgb",form:Tz},{base:"salvoconducto_vzla",id:"appzfvdMnCUnpQeq8",form:Lz},{base:"cita_saime",match:"constancia-saime",id:"app8bLzmgO7UcZF1h",form:Pz},{base:"visa_vzla",match:"visa",id:"appEIWO8RB2ELZZzx",form:Oz},{base:"fe_vida",match:"fe-vida",id:"appinv99a5JZOOLav",form:kz}],Uq=["2D679A46-6F53-4E26-8A7E-32327C752543"],Vq=[],kw=[{title:"Asunto:",state:"descripcion"},{title:"Dirigida a:",state:"dirigido"}],jq=[{name:Dq,sign:Dz,begTime:17197056e5,expTime:1735279199e3},{name:Fq,sign:Fz,begTime:17352792e5,expTime:Date.now()}],ca=({text:t,isValidation:e,loading:n})=>O.jsxs("div",{className:`loader-container ${e?"validation-loader":""}`,alt:"logo embajada",children:[O.jsx("img",{src:uk}),t&&O.jsxs("p",{children:[t,n&&O.jsx("span",{className:"dots"})]}),!t&&O.jsxs("p",{children:[Wz,O.jsx("br",{}),e?kq:Vz,O.jsx("span",{className:"dots"})]})]}),zq=({children:t})=>{const e=new Date().getTime(),{payDay:[n]}=X.useContext(yi);return n===1?O.jsx(ca,{loading:!0,text:Uz}):e>n||n===null?O.jsx(ca,{text:Sq}):O.jsx(O.Fragment,{children:t})},qq="/assets/salto_angel-DuGxnOIp.jpg",Gq="/assets/pico_bolivar-DkJN8CN5.jpeg",Hq="/assets/mcbo--3V86Ngz.jpeg",Wq="/assets/avila-7TbLiS7w.jpg",fk=[{title:"Carta de identidad",image:qq,link:"/carta-identidad",react:!0,home:!0,subtitle:"Salto Ángel, Bolívar"},{title:"Constancia cita SAIME",image:Gq,link:"/constancia-saime",react:!0,home:!0,subtitle:"Pico Bolívar, Merida"},{title:"Salvoconducto a Venezuela",image:Hq,link:"/salvoconducto-vzla",react:!0,home:!0,subtitle:"Puente sobre el Lago de Maracaibo, Zulia"},{title:"Visa",image:Wq,link:"/visa",react:!0,home:!0,subtitle:"Parque Nacional El Ávila, Caracas"},{title:"Fe de vida",link:"/fe-vida",react:!0},{title:"Apostilla",link:"https://legalizacionve.mppre.gob.ve/",react:!1,home:!1},{title:"SAREN",link:"https://www.saren.gob.ve/",react:!1,home:!1},{title:"SAIME",link:"https://www.saime.gob.ve/",react:!1,home:!1},{title:"Correo Electrónico",link:"mailto:tramitesconsularesvenmex@gmail.com",react:!1,home:!1},{title:"Whatsapp",link:"https://wa.me/525548209178",react:!1,home:!1}],$q=()=>O.jsx("div",{className:"links-section-container",children:fk.map(({title:t,image:e,link:n,home:r,subtitle:a})=>r&&O.jsxs(Kl,{className:"links-section",to:n,children:[O.jsx("img",{className:"links-section-image",src:e,alt:t}),O.jsx("div",{className:"links-section-button-container",children:O.jsx("p",{className:"links-section-button",children:t})}),O.jsx("p",{className:"links-section-subtitle",children:a})]},t))}),Kq="data:image/svg+xml,%3csvg%20id='Layer_1'%20data-name='Layer%201'%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2050%2050'%3e%3cdefs%3e%3cstyle%3e%20.cls-1%20{%20fill:%20%23dadada;%20}%20%3c/style%3e%3c/defs%3e%3cpath%20class='cls-1'%20d='M25.54,10.89l8.37,8.37c.14,.14,.34,.22,.54,.22h0c.68,0,1.02-.82,.54-1.3l-9.44-9.44c-.3-.3-.78-.3-1.08,0l-9.44,9.44c-.48,.48-.14,1.3,.54,1.3h0c.2,0,.4-.08,.54-.22l8.37-8.37c.3-.3,.78-.3,1.08,0Z'/%3e%3cg%3e%3cline%20class='cls-1'%20x1='25'%20y1='11.18'%20x2='25'%20y2='41.49'/%3e%3cpath%20class='cls-1'%20d='M24.16,11.18c0,10.1,0,20.21,0,30.31,0,1.08,1.68,1.08,1.68,0,0-10.1,0-20.21,0-30.31,0-1.08-1.68-1.08-1.68,0h0Z'/%3e%3c/g%3e%3c/svg%3e",pk=({color:t})=>O.jsx("div",{className:`button-to-top__container ${t?"alt-button-color":""}`,onClick:()=>window.scrollTo({top:0}),children:O.jsx("img",{src:Kq,className:"button-to-top"})}),Jq={prefix:"fab",iconName:"instagram",icon:[448,512,[],"f16d","M224.1 141c-63.6 0-114.9 51.3-114.9 114.9s51.3 114.9 114.9 114.9S339 319.5 339 255.9 287.7 141 224.1 141zm0 189.6c-41.1 0-74.7-33.5-74.7-74.7s33.5-74.7 74.7-74.7 74.7 33.5 74.7 74.7-33.6 74.7-74.7 74.7zm146.4-194.3c0 14.9-12 26.8-26.8 26.8-14.9 0-26.8-12-26.8-26.8s12-26.8 26.8-26.8 26.8 12 26.8 26.8zm76.1 27.2c-1.7-35.9-9.9-67.7-36.2-93.9-26.2-26.2-58-34.4-93.9-36.2-37-2.1-147.9-2.1-184.9 0-35.8 1.7-67.6 9.9-93.9 36.1s-34.4 58-36.2 93.9c-2.1 37-2.1 147.9 0 184.9 1.7 35.9 9.9 67.7 36.2 93.9s58 34.4 93.9 36.2c37 2.1 147.9 2.1 184.9 0 35.9-1.7 67.7-9.9 93.9-36.2 26.2-26.2 34.4-58 36.2-93.9 2.1-37 2.1-147.8 0-184.8zM398.8 388c-7.8 19.6-22.9 34.7-42.6 42.6-29.5 11.7-99.5 9-132.1 9s-102.7 2.6-132.1-9c-19.6-7.8-34.7-22.9-42.6-42.6-11.7-29.5-9-99.5-9-132.1s-2.6-102.7 9-132.1c7.8-19.6 22.9-34.7 42.6-42.6 29.5-11.7 99.5-9 132.1-9s102.7-2.6 132.1 9c19.6 7.8 34.7 22.9 42.6 42.6 11.7 29.5 9 99.5 9 132.1s2.7 102.7-9 132.1z"]},Yq={prefix:"fab",iconName:"facebook",icon:[512,512,[62e3],"f09a","M512 256C512 114.6 397.4 0 256 0S0 114.6 0 256C0 376 82.7 476.8 194.2 504.5V334.2H141.4V256h52.8V222.3c0-87.1 39.4-127.5 125-127.5c16.2 0 44.2 3.2 55.7 6.4V172c-6-.6-16.5-1-29.6-1c-42 0-58.2 15.9-58.2 57.2V256h83.6l-14.4 78.2H287V510.1C413.8 494.8 512 386.9 512 256h0z"]},Xq={prefix:"fab",iconName:"whatsapp",icon:[448,512,[],"f232","M380.9 97.1C339 55.1 283.2 32 223.9 32c-122.4 0-222 99.6-222 222 0 39.1 10.2 77.3 29.6 111L0 480l117.7-30.9c32.4 17.7 68.9 27 106.1 27h.1c122.3 0 224.1-99.6 224.1-222 0-59.3-25.2-115-67.1-157zm-157 341.6c-33.2 0-65.7-8.9-94-25.7l-6.7-4-69.8 18.3L72 359.2l-4.4-7c-18.5-29.4-28.2-63.3-28.2-98.2 0-101.7 82.8-184.5 184.6-184.5 49.3 0 95.6 19.2 130.4 54.1 34.8 34.9 56.2 81.2 56.1 130.5 0 101.8-84.9 184.6-186.6 184.6zm101.2-138.2c-5.5-2.8-32.8-16.2-37.9-18-5.1-1.9-8.8-2.8-12.5 2.8-3.7 5.6-14.3 18-17.6 21.8-3.2 3.7-6.5 4.2-12 1.4-32.6-16.3-54-29.1-75.5-66-5.7-9.8 5.7-9.1 16.3-30.3 1.8-3.7.9-6.9-.5-9.7-1.4-2.8-12.5-30.1-17.1-41.2-4.5-10.8-9.1-9.3-12.5-9.5-3.2-.2-6.9-.2-10.6-.2-3.7 0-9.7 1.4-14.8 6.9-5.1 5.6-19.4 19-19.4 46.3 0 27.3 19.9 53.7 22.6 57.4 2.8 3.7 39.1 59.7 94.8 83.8 35.2 15.2 49 16.5 66.6 13.9 10.7-1.6 32.8-13.4 37.4-26.4 4.6-13 4.6-24.1 3.2-26.4-1.3-2.5-5-3.9-10.5-6.6z"]},Qq={prefix:"fab",iconName:"twitter",icon:[512,512,[],"f099","M459.37 151.716c.325 4.548.325 9.097.325 13.645 0 138.72-105.583 298.558-298.558 298.558-59.452 0-114.68-17.219-161.137-47.106 8.447.974 16.568 1.299 25.34 1.299 49.055 0 94.213-16.568 130.274-44.832-46.132-.975-84.792-31.188-98.112-72.772 6.498.974 12.995 1.624 19.818 1.624 9.421 0 18.843-1.3 27.614-3.573-48.081-9.747-84.143-51.98-84.143-102.985v-1.299c13.969 7.797 30.214 12.67 47.431 13.319-28.264-18.843-46.781-51.005-46.781-87.391 0-19.492 5.197-37.36 14.294-52.954 51.655 63.675 129.3 105.258 216.365 109.807-1.624-7.797-2.599-15.918-2.599-24.04 0-57.828 46.782-104.934 104.934-104.934 30.213 0 57.502 12.67 76.67 33.137 23.715-4.548 46.456-13.32 66.599-25.34-7.798 24.366-24.366 44.833-46.132 57.827 21.117-2.273 41.584-8.122 60.426-16.243-14.292 20.791-32.161 39.308-52.628 54.253z"]},Zq={prefix:"fab",iconName:"telegram",icon:[496,512,[62462,"telegram-plane"],"f2c6","M248,8C111.033,8,0,119.033,0,256S111.033,504,248,504,496,392.967,496,256,384.967,8,248,8ZM362.952,176.66c-3.732,39.215-19.881,134.378-28.1,178.3-3.476,18.584-10.322,24.816-16.948,25.425-14.4,1.326-25.338-9.517-39.287-18.661-21.827-14.308-34.158-23.215-55.346-37.177-24.485-16.135-8.612-25,5.342-39.5,3.652-3.793,67.107-61.51,68.335-66.746.153-.655.3-3.1-1.154-4.384s-3.59-.849-5.135-.5q-3.283.746-104.608,69.142-14.845,10.194-26.894,9.934c-8.855-.191-25.888-5.006-38.551-9.123-15.531-5.048-27.875-7.717-26.8-16.291q.84-6.7,18.45-13.7,108.446-47.248,144.628-62.3c68.872-28.647,83.183-33.623,92.511-33.789,2.052-.034,6.639.474,9.61,2.885a10.452,10.452,0,0,1,3.53,6.716A43.765,43.765,0,0,1,362.952,176.66Z"]},eG=` Bienvenido a la página web oficial de la Sección de Trámites Consulares de la Embajada de la República Bolivariana de Venezuela en los Estados Unidos Mexicanos.

1. Todos los trámites en esta plataforma son autogestionados. Si se comete algún error al completar una forma, este se reflejará en el resultado de su trámite.
2. Exceptuando las visas y/o salvoconductos, los trámites serán enviados a su correo electrónico en un plazo de 24 a 48 horas. Si no recibe respuesta en ese lapso, por favor comuníquese con nuestro personal acreditado en la Embajada para obtener información. En caso de que el trámite deba ser retirado en la sede de la Embajada, será entregado el mismo día de la solicitud. `,tG='Desarrollado por sitrive.com',nG=[{title:"Carta de identidad",react:!0,children:[{title:"Solicitar CI",link:"/carta-identidad"}],description:"Documento que certifica la nacionalidad del solicitante."},{title:"Constancia cita SAIME",react:!0,children:[{title:"Solicitar CCS",link:"/constancia-saime"}],description:"Documento que certifica que posee una cita para trámite de pasaporte."},{title:"Salvoconducto a Venezuela",react:!0,children:[{title:"Solicitar SAV",link:"/salvoconducto-vzla"}],description:"Documento que permite ingresar a territorio venezolano sin pasaporte."},{title:"Visa",react:!0,children:[{title:"Solicitar VISA",link:"/visa"}],description:"Documento que autoriza a un ciudadano extranjero a entrar, permanecer temporalmente o transitar por el territorio venezolano."},{title:"Fe de vida",react:!0,children:[{title:"Solicitar FDV",link:"/fe-vida"}],description:"Documento que certifica que una persona se encuentra viva en una fecha específica."}],rG=[{icon:Jq,link:"https://www.instagram.com/embavenmexico?igsh=ZzR3aGdzN2RpZDBu",title:"instagram"},{icon:Qq,link:"https://x.com/EmbaVenMexico?t=-TwQ_oJ91coUFdnjCf2zcw&s=09",title:"twitter"},{icon:Yq,link:"https://www.facebook.com/VenezuelaEnMexico?mibextid=ZbWKwL",title:"facebook"},{icon:Xq,link:"https://whatsapp.com/channel/0029VaDxxPF002TCf315Wk0K",title:"whatsapp"},{icon:Zq,link:"https://t.me/Embavenmexico",title:"telegram"}],Jg={title:pq,link:"https://legalizacionve.mppre.gob.ve",react:!1,children:[{title:"Whatsapp",link:"https://wa.me/529984957575"},{title:"Web oficial",link:"https://conviasa.aero/"},{title:"Puerto Ayacucho, Amazonas",link:"https://www.google.com/maps/search/?api=1&query=Aeropuerto+Cacique+Aramare,+entre+Av.+Perimetral+y+Av.+El+Ejército,+Puerto+Ayacucho,+Edo.+Amazonas",email:"ato.puertoayacucho@conviasa.aero"},{title:"Barcelona, Anzoátegui",link:"https://www.google.com/maps/search/?api=1&query=Aeropuerto+Internacional+General+José+António+Anzoátegui,+Barcelona,+Edo.+Anzoátegui",email:"oficina.barcelona@conviasa.aero"},{title:"San Tomé, Anzoátegui",link:"https://www.google.com/maps/search/?api=1&query=Aeropuerto+Don+Edmundo+Barrios,+San+Tomé,+Edo.+Anzoátegui",email:"ato.santome@conviasa.aero"},{title:"San Fernando de Apure, Apure",link:"https://www.google.com/maps/search/?api=1&query=Aeropuerto+Nacional+de+Las+Flecheras,+San+Fernando+de+Apure,+Edo.+Apure",email:"ato.sanfernando@conviasa.aero"},{title:"Barinas, Barinas",link:"https://www.google.com/maps/search/?api=1&query=Aeropuerto+Nacional+de+Barinas,+Av.+Adonay+Parra+Jiménez,+Barinas,+Edo.+Barinas",email:"ato.barinas@conviasa.aero"},{title:"Puerto Ordaz, Bolívar",link:"https://www.google.com/maps/search/?api=1&query=Aeropuerto+Internacional+Manuel+Carlos+Piar,+Puerto+Ordaz,+Edo.+Bolívar",email:"ato.puertoordaz@conviasa.aero"},{title:"Valencia, Carabobo",link:"https://www.google.com/maps/search/?api=1&query=Av.+Ernesto+Brangger,+Aeropuerto+Nacional+Arturo+Michelena,+Valencia,+Edo.+Carabobo",email:"oficina.valencia@conviasa.aero"},{title:"Chacao, DC",link:"https://www.google.com/maps/search/?api=1&query=Av.+Francisco+de+Miranda,+Torre+MPPTT,+PB,+al+lado+de+la+estación+%22Chacao%22+del+Metro+de+Caracas,+Caracas,+Edo.+Distrito+Capital",email:"oficina.chacao@conviasa.aero"},{title:"CC Los Próceres IPSFA, DC",link:"https://www.google.com/maps/search/?api=1&query=Av.+Los+Próceres,+Centro+Comercial+Los+Próceres+IPSFA,+PB,+al+lado+del+Banco+Venezuela,+Caracas,+Edo.+Distrito+Capital",email:"oficina.ipsfa@conviasa.aero"},{title:"Las Piedras, Falcón",link:"https://www.google.com/maps/search/?api=1&query=Aeropuerto+Internacional+Josefa+Camejo,+Av.+Guillermo+Lucas+Castillo,+Las+Piedras,+Punto+Fijo,+Edo.+Falcón",email:"ato.laspiedras@conviasa.aero"},{title:"Aeropuerto Simón Bolívar, La Guaira",link:"https://www.google.com/maps/search/?api=1&query=Av.+Intercomunal+Aeropuerto+Simón+Bolívar,+Aeropuerto+Nacional,+Edo.+La+Guaira",email:"oficina.maiquetia@conviasa.aero"},{title:"Aeropuerto Internacional Simón Bolívar, La Guaira",link:"https://www.google.com/maps/search/?api=1&query=Av.+Intercomunal+Aeropuerto+Simón+Bolívar,+Terminal+Internacional+mostradores+Conviasa,+Maiquetía,+Edo.+La+Guaira",email:"ato.miqint@conviasa.aero"},{title:"Barquisimeto, Lara",link:"https://www.google.com/maps/search/?api=1&query=Aeropuerto+Internacional+Jacinto+Lara,+Final+Av.+la+Salle+con+Av.+Vicente+Landaeta+Gil,+Barquisimeto,+Edo.+Lara",email:"ato.barquisimeto@conviasa.aero"},{title:"El Vigía, Mérida",link:"https://www.google.com/maps/search/?api=1&query=Av.+José+António+Páez,+Aeropuerto+Internacional+Juan+Pablo+Pérez+Alfonzo,+Sector+Bubuqui+5,+El+Vigía,+Edo.+Mérida",email:"ato.vigia@conviasa.aero"},{title:"Mérida, Mérida",link:"https://www.google.com/maps/search/?api=1&query=Av.+Urdaneta,+Aeropuerto+Alberto+Carnevalli,+Salón+principal,+Local+08,+Mérida,+Edo.+Mérida",email:"oficina.merida@conviasa.aero"},{title:"Maturín, Monagas",link:"https://www.google.com/maps/search/?api=1&query=Aeropuerto+Internacional+José+Tadeo+Monagas,+Av.+José+Tadeo+Monagas,+Maturín,+Edo.+Monagas",email:"ato.maturin@conviasa.aero"},{title:"Hotel Puerta del Sol, Nueva Esparta",link:"https://www.google.com/maps/search/?api=1&query=Hotel+Puertas+del+Sol,+calle+Los+Pinos+entre+la+4+de+Mayo+y+Terranova,+Isla+de+Margarita,+Edo.+Nueva+Esparta",email:"oficina.porlamar@conviasa.aero"},{title:"Porlamar, Nueva Esparta",link:"https://www.google.com/maps/search/?api=1&query=Aeropuerto+Internacional+del+Caribe+Santiago+Mariño,+Sector+%22El+Yaque%22,+Edo.+Nueva+Esparta",email:"ato.porlamar@conviasa.aero"},{title:"Cumaná, Sucre",link:"https://www.google.com/maps/search/?api=1&query=Aeropuerto+Antonio+José+de+Sucre,+Urbanización+Campeche+Sector+3,+Cumaná,+Edo.+Sucre",email:"ato.cumana@conviasa.aero"},{title:"CC. La Villa, Táchira",link:"https://www.google.com/maps/search/?api=1&query=Av.+Guayana,+Centro+Comercial+Paseo+La+Villa,+Tercer+Nivel+del+Bloque+B-1,+Local+B1-15,+San+Cristóbal,+Edo.+Táchira",email:"oficina.sancristobal@conviasa.aero"},{title:"La Fría, Táchira",link:"https://www.google.com/maps/search/?api=1&query=Aeropuerto+Internacional+Francisco+García+de+Hevia,+La+Fría,+Edo.+Táchira",email:"ato.lafria@conviasa.aero"},{title:"Santo Domingo, Táchira",link:"https://www.google.com/maps/search/?api=1&query=Aeropuerto+Internacional+Base+Aérea+Mayor+Buenaventura+Vivas,+Santo+Domingo,+Edo.+Táchira",email:"ato.santodomingo@conviasa.aero"},{title:"Maracaibo, Zulia",link:"https://www.google.com/maps/search/?api=1&query=Aeropuerto+Internacional+La+Chinita,+Av.+Don+Manuel+Belloso,+Maracaibo,+Edo.+Zulia",email:"ato.maracaibo@conviasa.aero"},{title:"AIFA, México",link:"https://maps.app.goo.gl/YrBBhx7NFsi27jGw8"}],description:"Información para compra de boletos aéreos por whatsapp, página oficial y por oficinas."},aG=()=>O.jsxs("div",{className:"footer-conviasa-out-container",children:[O.jsx("p",{className:"footer-link-title my-0",children:Jg.title}),O.jsx("p",{className:"footer-link-des",children:Jg.description}),O.jsx("div",{className:"footer-conviasa-container",children:Jg.children.map(({title:t,link:e,email:n})=>O.jsxs("div",{className:"conviasa-of-links",children:[O.jsx("a",{className:"footer-link",href:e,target:"_blank",children:t}),n&&O.jsx("a",{className:"footer-link conviasa-link",href:`mailto:${n}`,target:"_blank",children:mq})]},t))})]}),iG=()=>O.jsx("div",{className:"footer-links-container",children:nG.map(({title:t,react:e,children:n,description:r})=>O.jsxs("div",{children:[O.jsx("p",{className:"footer-link-title",children:t}),O.jsx("p",{className:"footer-link-des",children:r}),O.jsx("div",{className:"footer-links-inside-container",children:n.map(({title:a,link:i})=>e?O.jsx(Kl,{className:"footer-link",to:i,children:a},a):O.jsx("a",{className:"footer-link",href:i,target:"_blank",children:a},a))})]},t))}),Nw=()=>{};let QE={},mk={},gk=null,vk={mark:Nw,measure:Nw};try{typeof window<"u"&&(QE=window),typeof document<"u"&&(mk=document),typeof MutationObserver<"u"&&(gk=MutationObserver),typeof performance<"u"&&(vk=performance)}catch{}const{userAgent:Ow=""}=QE.navigator||{},ys=QE,wt=mk,Mw=gk,pf=vk;ys.document;const Ei=!!wt.documentElement&&!!wt.head&&typeof wt.addEventListener=="function"&&typeof wt.createElement=="function",_k=~Ow.indexOf("MSIE")||~Ow.indexOf("Trident/");var Pt="classic",yk="duotone",wr="sharp",Cr="sharp-duotone",sG=[Pt,yk,wr,Cr],oG={classic:{900:"fas",400:"far",normal:"far",300:"fal",100:"fat"},sharp:{900:"fass",400:"fasr",300:"fasl",100:"fast"},"sharp-duotone":{900:"fasds"}},Lw={kit:{fak:"kit","fa-kit":"kit"},"kit-duotone":{fakd:"kit-duotone","fa-kit-duotone":"kit-duotone"}},lG=["kit"],uG=/fa(s|r|l|t|d|b|k|kd|ss|sr|sl|st|sds)?[\-\ ]/,cG=/Font ?Awesome ?([56 ]*)(Solid|Regular|Light|Thin|Duotone|Brands|Free|Pro|Sharp Duotone|Sharp|Kit)?.*/i,dG={"Font Awesome 5 Free":{900:"fas",400:"far"},"Font Awesome 5 Pro":{900:"fas",400:"far",normal:"far",300:"fal"},"Font Awesome 5 Brands":{400:"fab",normal:"fab"},"Font Awesome 5 Duotone":{900:"fad"}},hG={"Font Awesome 6 Free":{900:"fas",400:"far"},"Font Awesome 6 Pro":{900:"fas",400:"far",normal:"far",300:"fal",100:"fat"},"Font Awesome 6 Brands":{400:"fab",normal:"fab"},"Font Awesome 6 Duotone":{900:"fad"},"Font Awesome 6 Sharp":{900:"fass",400:"fasr",normal:"fasr",300:"fasl",100:"fast"},"Font Awesome 6 Sharp Duotone":{900:"fasds"}},fG={classic:{"fa-brands":"fab","fa-duotone":"fad","fa-light":"fal","fa-regular":"far","fa-solid":"fas","fa-thin":"fat"},sharp:{"fa-solid":"fass","fa-regular":"fasr","fa-light":"fasl","fa-thin":"fast"},"sharp-duotone":{"fa-solid":"fasds"}},pG={classic:["fas","far","fal","fat"],sharp:["fass","fasr","fasl","fast"],"sharp-duotone":["fasds"]},mG={classic:{fab:"fa-brands",fad:"fa-duotone",fal:"fa-light",far:"fa-regular",fas:"fa-solid",fat:"fa-thin"},sharp:{fass:"fa-solid",fasr:"fa-regular",fasl:"fa-light",fast:"fa-thin"},"sharp-duotone":{fasds:"fa-solid"}},gG={classic:{solid:"fas",regular:"far",light:"fal",thin:"fat",duotone:"fad",brands:"fab"},sharp:{solid:"fass",regular:"fasr",light:"fasl",thin:"fast"},"sharp-duotone":{solid:"fasds"}},Ek={classic:{fa:"solid",fas:"solid","fa-solid":"solid",far:"regular","fa-regular":"regular",fal:"light","fa-light":"light",fat:"thin","fa-thin":"thin",fad:"duotone","fa-duotone":"duotone",fab:"brands","fa-brands":"brands"},sharp:{fa:"solid",fass:"solid","fa-solid":"solid",fasr:"regular","fa-regular":"regular",fasl:"light","fa-light":"light",fast:"thin","fa-thin":"thin"},"sharp-duotone":{fa:"solid",fasds:"solid","fa-solid":"solid"}},vG=["solid","regular","light","thin","duotone","brands"],bk=[1,2,3,4,5,6,7,8,9,10],_G=bk.concat([11,12,13,14,15,16,17,18,19,20]),_c={GROUP:"duotone-group",SWAP_OPACITY:"swap-opacity",PRIMARY:"primary",SECONDARY:"secondary"},yG=[...Object.keys(pG),...vG,"2xs","xs","sm","lg","xl","2xl","beat","border","fade","beat-fade","bounce","flip-both","flip-horizontal","flip-vertical","flip","fw","inverse","layers-counter","layers-text","layers","li","pull-left","pull-right","pulse","rotate-180","rotate-270","rotate-90","rotate-by","shake","spin-pulse","spin-reverse","spin","stack-1x","stack-2x","stack","ul",_c.GROUP,_c.SWAP_OPACITY,_c.PRIMARY,_c.SECONDARY].concat(bk.map(t=>"".concat(t,"x"))).concat(_G.map(t=>"w-".concat(t))),EG={"Font Awesome Kit":{400:"fak",normal:"fak"},"Font Awesome Kit Duotone":{400:"fakd",normal:"fakd"}},bG={kit:{"fa-kit":"fak"},"kit-duotone":{"fa-kit-duotone":"fakd"}},xG={kit:{fak:"fa-kit"},"kit-duotone":{fakd:"fa-kit-duotone"}},Dw={kit:{kit:"fak"},"kit-duotone":{"kit-duotone":"fakd"}};const hi="___FONT_AWESOME___",Z1=16,xk="fa",Sk="svg-inline--fa",wo="data-fa-i2svg",e_="data-fa-pseudo-element",SG="data-fa-pseudo-element-pending",ZE="data-prefix",eb="data-icon",Fw="fontawesome-i2svg",TG="async",wG=["HTML","HEAD","STYLE","SCRIPT"],Tk=(()=>{try{return!0}catch{return!1}})(),wk=[Pt,wr,Cr];function gh(t){return new Proxy(t,{get(e,n){return n in e?e[n]:e[Pt]}})}const Ck={...Ek};Ck[Pt]={...Ek[Pt],...Lw.kit,...Lw["kit-duotone"]};const so=gh(Ck),t_={...gG};t_[Pt]={...t_[Pt],...Dw.kit,...Dw["kit-duotone"]};const Nd=gh(t_),n_={...mG};n_[Pt]={...n_[Pt],...xG.kit};const oo=gh(n_),r_={...fG};r_[Pt]={...r_[Pt],...bG.kit};const CG=gh(r_),AG=uG,Ak="fa-layers-text",IG=cG,PG={...oG};gh(PG);const RG=["class","data-prefix","data-icon","data-fa-transform","data-fa-mask"],Yg=_c,ou=new Set;Object.keys(Nd[Pt]).map(ou.add.bind(ou));Object.keys(Nd[wr]).map(ou.add.bind(ou));Object.keys(Nd[Cr]).map(ou.add.bind(ou));const kG=[...lG,...yG],Vc=ys.FontAwesomeConfig||{};function NG(t){var e=wt.querySelector("script["+t+"]");if(e)return e.getAttribute(t)}function OG(t){return t===""?!0:t==="false"?!1:t==="true"?!0:t}wt&&typeof wt.querySelector=="function"&&[["data-family-prefix","familyPrefix"],["data-css-prefix","cssPrefix"],["data-family-default","familyDefault"],["data-style-default","styleDefault"],["data-replacement-class","replacementClass"],["data-auto-replace-svg","autoReplaceSvg"],["data-auto-add-css","autoAddCss"],["data-auto-a11y","autoA11y"],["data-search-pseudo-elements","searchPseudoElements"],["data-observe-mutations","observeMutations"],["data-mutate-approach","mutateApproach"],["data-keep-original-source","keepOriginalSource"],["data-measure-performance","measurePerformance"],["data-show-missing-icons","showMissingIcons"]].forEach(e=>{let[n,r]=e;const a=OG(NG(n));a!=null&&(Vc[r]=a)});const Ik={styleDefault:"solid",familyDefault:"classic",cssPrefix:xk,replacementClass:Sk,autoReplaceSvg:!0,autoAddCss:!0,autoA11y:!0,searchPseudoElements:!1,observeMutations:!0,mutateApproach:"async",keepOriginalSource:!0,measurePerformance:!1,showMissingIcons:!0};Vc.familyPrefix&&(Vc.cssPrefix=Vc.familyPrefix);const lu={...Ik,...Vc};lu.autoReplaceSvg||(lu.observeMutations=!1);const Te={};Object.keys(Ik).forEach(t=>{Object.defineProperty(Te,t,{enumerable:!0,set:function(e){lu[t]=e,jc.forEach(n=>n(Te))},get:function(){return lu[t]}})});Object.defineProperty(Te,"familyPrefix",{enumerable:!0,set:function(t){lu.cssPrefix=t,jc.forEach(e=>e(Te))},get:function(){return lu.cssPrefix}});ys.FontAwesomeConfig=Te;const jc=[];function MG(t){return jc.push(t),()=>{jc.splice(jc.indexOf(t),1)}}const Pi=Z1,xa={size:16,x:0,y:0,rotate:0,flipX:!1,flipY:!1};function LG(t){if(!t||!Ei)return;const e=wt.createElement("style");e.setAttribute("type","text/css"),e.innerHTML=t;const n=wt.head.childNodes;let r=null;for(let a=n.length-1;a>-1;a--){const i=n[a],s=(i.tagName||"").toUpperCase();["STYLE","LINK"].indexOf(s)>-1&&(r=i)}return wt.head.insertBefore(e,r),t}const DG="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";function Od(){let t=12,e="";for(;t-- >0;)e+=DG[Math.random()*62|0];return e}function wu(t){const e=[];for(let n=(t||[]).length>>>0;n--;)e[n]=t[n];return e}function tb(t){return t.classList?wu(t.classList):(t.getAttribute("class")||"").split(" ").filter(e=>e)}function Pk(t){return"".concat(t).replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(//g,">")}function FG(t){return Object.keys(t||{}).reduce((e,n)=>e+"".concat(n,'="').concat(Pk(t[n]),'" '),"").trim()}function Em(t){return Object.keys(t||{}).reduce((e,n)=>e+"".concat(n,": ").concat(t[n].trim(),";"),"")}function nb(t){return t.size!==xa.size||t.x!==xa.x||t.y!==xa.y||t.rotate!==xa.rotate||t.flipX||t.flipY}function BG(t){let{transform:e,containerWidth:n,iconWidth:r}=t;const a={transform:"translate(".concat(n/2," 256)")},i="translate(".concat(e.x*32,", ").concat(e.y*32,") "),s="scale(".concat(e.size/16*(e.flipX?-1:1),", ").concat(e.size/16*(e.flipY?-1:1),") "),o="rotate(".concat(e.rotate," 0 0)"),l={transform:"".concat(i," ").concat(s," ").concat(o)},u={transform:"translate(".concat(r/2*-1," -256)")};return{outer:a,inner:l,path:u}}function UG(t){let{transform:e,width:n=Z1,height:r=Z1,startCentered:a=!1}=t,i="";return a&&_k?i+="translate(".concat(e.x/Pi-n/2,"em, ").concat(e.y/Pi-r/2,"em) "):a?i+="translate(calc(-50% + ".concat(e.x/Pi,"em), calc(-50% + ").concat(e.y/Pi,"em)) "):i+="translate(".concat(e.x/Pi,"em, ").concat(e.y/Pi,"em) "),i+="scale(".concat(e.size/Pi*(e.flipX?-1:1),", ").concat(e.size/Pi*(e.flipY?-1:1),") "),i+="rotate(".concat(e.rotate,"deg) "),i}var VG=`:root, :host { --fa-font-solid: normal 900 1em/1 "Font Awesome 6 Free"; --fa-font-regular: normal 400 1em/1 "Font Awesome 6 Free"; --fa-font-light: normal 300 1em/1 "Font Awesome 6 Pro"; --fa-font-thin: normal 100 1em/1 "Font Awesome 6 Pro"; --fa-font-duotone: normal 900 1em/1 "Font Awesome 6 Duotone"; --fa-font-brands: normal 400 1em/1 "Font Awesome 6 Brands"; --fa-font-sharp-solid: normal 900 1em/1 "Font Awesome 6 Sharp"; --fa-font-sharp-regular: normal 400 1em/1 "Font Awesome 6 Sharp"; --fa-font-sharp-light: normal 300 1em/1 "Font Awesome 6 Sharp"; --fa-font-sharp-thin: normal 100 1em/1 "Font Awesome 6 Sharp"; --fa-font-sharp-duotone-solid: normal 900 1em/1 "Font Awesome 6 Sharp Duotone"; } svg:not(:root).svg-inline--fa, svg:not(:host).svg-inline--fa { overflow: visible; box-sizing: content-box; } .svg-inline--fa { display: var(--fa-display, inline-block); height: 1em; overflow: visible; vertical-align: -0.125em; } .svg-inline--fa.fa-2xs { vertical-align: 0.1em; } .svg-inline--fa.fa-xs { vertical-align: 0em; } .svg-inline--fa.fa-sm { vertical-align: -0.0714285705em; } .svg-inline--fa.fa-lg { vertical-align: -0.2em; } .svg-inline--fa.fa-xl { vertical-align: -0.25em; } .svg-inline--fa.fa-2xl { vertical-align: -0.3125em; } .svg-inline--fa.fa-pull-left { margin-right: var(--fa-pull-margin, 0.3em); width: auto; } .svg-inline--fa.fa-pull-right { margin-left: var(--fa-pull-margin, 0.3em); width: auto; } .svg-inline--fa.fa-li { width: var(--fa-li-width, 2em); top: 0.25em; } .svg-inline--fa.fa-fw { width: var(--fa-fw-width, 1.25em); } .fa-layers svg.svg-inline--fa { bottom: 0; left: 0; margin: auto; position: absolute; right: 0; top: 0; } .fa-layers-counter, .fa-layers-text { display: inline-block; position: absolute; text-align: center; } .fa-layers { display: inline-block; height: 1em; position: relative; text-align: center; vertical-align: -0.125em; width: 1em; } .fa-layers svg.svg-inline--fa { transform-origin: center center; } .fa-layers-text { left: 50%; top: 50%; transform: translate(-50%, -50%); transform-origin: center center; } .fa-layers-counter { background-color: var(--fa-counter-background-color, #ff253a); border-radius: var(--fa-counter-border-radius, 1em); box-sizing: border-box; color: var(--fa-inverse, #fff); line-height: var(--fa-counter-line-height, 1); max-width: var(--fa-counter-max-width, 5em); min-width: var(--fa-counter-min-width, 1.5em); overflow: hidden; padding: var(--fa-counter-padding, 0.25em 0.5em); right: var(--fa-right, 0); text-overflow: ellipsis; top: var(--fa-top, 0); transform: scale(var(--fa-counter-scale, 0.25)); transform-origin: top right; } .fa-layers-bottom-right { bottom: var(--fa-bottom, 0); right: var(--fa-right, 0); top: auto; transform: scale(var(--fa-layers-scale, 0.25)); transform-origin: bottom right; } .fa-layers-bottom-left { bottom: var(--fa-bottom, 0); left: var(--fa-left, 0); right: auto; top: auto; transform: scale(var(--fa-layers-scale, 0.25)); transform-origin: bottom left; } .fa-layers-top-right { top: var(--fa-top, 0); right: var(--fa-right, 0); transform: scale(var(--fa-layers-scale, 0.25)); transform-origin: top right; } .fa-layers-top-left { left: var(--fa-left, 0); right: auto; top: var(--fa-top, 0); transform: scale(var(--fa-layers-scale, 0.25)); transform-origin: top left; } .fa-1x { font-size: 1em; } .fa-2x { font-size: 2em; } .fa-3x { font-size: 3em; } .fa-4x { font-size: 4em; } .fa-5x { font-size: 5em; } .fa-6x { font-size: 6em; } .fa-7x { font-size: 7em; } .fa-8x { font-size: 8em; } .fa-9x { font-size: 9em; } .fa-10x { font-size: 10em; } .fa-2xs { font-size: 0.625em; line-height: 0.1em; vertical-align: 0.225em; } .fa-xs { font-size: 0.75em; line-height: 0.0833333337em; vertical-align: 0.125em; } .fa-sm { font-size: 0.875em; line-height: 0.0714285718em; vertical-align: 0.0535714295em; } .fa-lg { font-size: 1.25em; line-height: 0.05em; vertical-align: -0.075em; } .fa-xl { font-size: 1.5em; line-height: 0.0416666682em; vertical-align: -0.125em; } .fa-2xl { font-size: 2em; line-height: 0.03125em; vertical-align: -0.1875em; } .fa-fw { text-align: center; width: 1.25em; } .fa-ul { list-style-type: none; margin-left: var(--fa-li-margin, 2.5em); padding-left: 0; } .fa-ul > li { position: relative; } .fa-li { left: calc(-1 * var(--fa-li-width, 2em)); position: absolute; text-align: center; width: var(--fa-li-width, 2em); line-height: inherit; } .fa-border { border-color: var(--fa-border-color, #eee); border-radius: var(--fa-border-radius, 0.1em); border-style: var(--fa-border-style, solid); border-width: var(--fa-border-width, 0.08em); padding: var(--fa-border-padding, 0.2em 0.25em 0.15em); } .fa-pull-left { float: left; margin-right: var(--fa-pull-margin, 0.3em); } .fa-pull-right { float: right; margin-left: var(--fa-pull-margin, 0.3em); } .fa-beat { animation-name: fa-beat; animation-delay: var(--fa-animation-delay, 0s); animation-direction: var(--fa-animation-direction, normal); animation-duration: var(--fa-animation-duration, 1s); animation-iteration-count: var(--fa-animation-iteration-count, infinite); animation-timing-function: var(--fa-animation-timing, ease-in-out); } .fa-bounce { animation-name: fa-bounce; animation-delay: var(--fa-animation-delay, 0s); animation-direction: var(--fa-animation-direction, normal); animation-duration: var(--fa-animation-duration, 1s); animation-iteration-count: var(--fa-animation-iteration-count, infinite); animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.28, 0.84, 0.42, 1)); } .fa-fade { animation-name: fa-fade; animation-delay: var(--fa-animation-delay, 0s); animation-direction: var(--fa-animation-direction, normal); animation-duration: var(--fa-animation-duration, 1s); animation-iteration-count: var(--fa-animation-iteration-count, infinite); animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.4, 0, 0.6, 1)); } .fa-beat-fade { animation-name: fa-beat-fade; animation-delay: var(--fa-animation-delay, 0s); animation-direction: var(--fa-animation-direction, normal); animation-duration: var(--fa-animation-duration, 1s); animation-iteration-count: var(--fa-animation-iteration-count, infinite); animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.4, 0, 0.6, 1)); } .fa-flip { animation-name: fa-flip; animation-delay: var(--fa-animation-delay, 0s); animation-direction: var(--fa-animation-direction, normal); animation-duration: var(--fa-animation-duration, 1s); animation-iteration-count: var(--fa-animation-iteration-count, infinite); animation-timing-function: var(--fa-animation-timing, ease-in-out); } .fa-shake { animation-name: fa-shake; animation-delay: var(--fa-animation-delay, 0s); animation-direction: var(--fa-animation-direction, normal); animation-duration: var(--fa-animation-duration, 1s); animation-iteration-count: var(--fa-animation-iteration-count, infinite); animation-timing-function: var(--fa-animation-timing, linear); } .fa-spin { animation-name: fa-spin; animation-delay: var(--fa-animation-delay, 0s); animation-direction: var(--fa-animation-direction, normal); animation-duration: var(--fa-animation-duration, 2s); animation-iteration-count: var(--fa-animation-iteration-count, infinite); animation-timing-function: var(--fa-animation-timing, linear); } .fa-spin-reverse { --fa-animation-direction: reverse; } .fa-pulse, .fa-spin-pulse { animation-name: fa-spin; animation-direction: var(--fa-animation-direction, normal); animation-duration: var(--fa-animation-duration, 1s); animation-iteration-count: var(--fa-animation-iteration-count, infinite); animation-timing-function: var(--fa-animation-timing, steps(8)); } @media (prefers-reduced-motion: reduce) { .fa-beat, .fa-bounce, .fa-fade, .fa-beat-fade, .fa-flip, .fa-pulse, .fa-shake, .fa-spin, .fa-spin-pulse { animation-delay: -1ms; animation-duration: 1ms; animation-iteration-count: 1; transition-delay: 0s; transition-duration: 0s; } } @keyframes fa-beat { 0%, 90% { transform: scale(1); } 45% { transform: scale(var(--fa-beat-scale, 1.25)); } } @keyframes fa-bounce { 0% { transform: scale(1, 1) translateY(0); } 10% { transform: scale(var(--fa-bounce-start-scale-x, 1.1), var(--fa-bounce-start-scale-y, 0.9)) translateY(0); } 30% { transform: scale(var(--fa-bounce-jump-scale-x, 0.9), var(--fa-bounce-jump-scale-y, 1.1)) translateY(var(--fa-bounce-height, -0.5em)); } 50% { transform: scale(var(--fa-bounce-land-scale-x, 1.05), var(--fa-bounce-land-scale-y, 0.95)) translateY(0); } 57% { transform: scale(1, 1) translateY(var(--fa-bounce-rebound, -0.125em)); } 64% { transform: scale(1, 1) translateY(0); } 100% { transform: scale(1, 1) translateY(0); } } @keyframes fa-fade { 50% { opacity: var(--fa-fade-opacity, 0.4); } } @keyframes fa-beat-fade { 0%, 100% { opacity: var(--fa-beat-fade-opacity, 0.4); transform: scale(1); } 50% { opacity: 1; transform: scale(var(--fa-beat-fade-scale, 1.125)); } } @keyframes fa-flip { 50% { transform: rotate3d(var(--fa-flip-x, 0), var(--fa-flip-y, 1), var(--fa-flip-z, 0), var(--fa-flip-angle, -180deg)); } } @keyframes fa-shake { 0% { transform: rotate(-15deg); } 4% { transform: rotate(15deg); } 8%, 24% { transform: rotate(-18deg); } 12%, 28% { transform: rotate(18deg); } 16% { transform: rotate(-22deg); } 20% { transform: rotate(22deg); } 32% { transform: rotate(-12deg); } 36% { transform: rotate(12deg); } 40%, 100% { transform: rotate(0deg); } } @keyframes fa-spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } } .fa-rotate-90 { transform: rotate(90deg); } .fa-rotate-180 { transform: rotate(180deg); } .fa-rotate-270 { transform: rotate(270deg); } .fa-flip-horizontal { transform: scale(-1, 1); } .fa-flip-vertical { transform: scale(1, -1); } .fa-flip-both, .fa-flip-horizontal.fa-flip-vertical { transform: scale(-1, -1); } .fa-rotate-by { transform: rotate(var(--fa-rotate-angle, 0)); } .fa-stack { display: inline-block; vertical-align: middle; height: 2em; position: relative; width: 2.5em; } .fa-stack-1x, .fa-stack-2x { bottom: 0; left: 0; margin: auto; position: absolute; right: 0; top: 0; z-index: var(--fa-stack-z-index, auto); } .svg-inline--fa.fa-stack-1x { height: 1em; width: 1.25em; } .svg-inline--fa.fa-stack-2x { height: 2em; width: 2.5em; } .fa-inverse { color: var(--fa-inverse, #fff); } .sr-only, .fa-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border-width: 0; } .sr-only-focusable:not(:focus), .fa-sr-only-focusable:not(:focus) { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border-width: 0; } .svg-inline--fa .fa-primary { fill: var(--fa-primary-color, currentColor); opacity: var(--fa-primary-opacity, 1); } .svg-inline--fa .fa-secondary { fill: var(--fa-secondary-color, currentColor); opacity: var(--fa-secondary-opacity, 0.4); } .svg-inline--fa.fa-swap-opacity .fa-primary { opacity: var(--fa-secondary-opacity, 0.4); } .svg-inline--fa.fa-swap-opacity .fa-secondary { opacity: var(--fa-primary-opacity, 1); } .svg-inline--fa mask .fa-primary, .svg-inline--fa mask .fa-secondary { fill: black; } .fad.fa-inverse, .fa-duotone.fa-inverse { color: var(--fa-inverse, #fff); }`;function Rk(){const t=xk,e=Sk,n=Te.cssPrefix,r=Te.replacementClass;let a=VG;if(n!==t||r!==e){const i=new RegExp("\\.".concat(t,"\\-"),"g"),s=new RegExp("\\--".concat(t,"\\-"),"g"),o=new RegExp("\\.".concat(e),"g");a=a.replace(i,".".concat(n,"-")).replace(s,"--".concat(n,"-")).replace(o,".".concat(r))}return a}let Bw=!1;function Xg(){Te.autoAddCss&&!Bw&&(LG(Rk()),Bw=!0)}var jG={mixout(){return{dom:{css:Rk,insertCss:Xg}}},hooks(){return{beforeDOMElementCreation(){Xg()},beforeI2svg(){Xg()}}}};const fi=ys||{};fi[hi]||(fi[hi]={});fi[hi].styles||(fi[hi].styles={});fi[hi].hooks||(fi[hi].hooks={});fi[hi].shims||(fi[hi].shims=[]);var Sa=fi[hi];const kk=[],Nk=function(){wt.removeEventListener("DOMContentLoaded",Nk),t0=1,kk.map(t=>t())};let t0=!1;Ei&&(t0=(wt.documentElement.doScroll?/^loaded|^c/:/^loaded|^i|^c/).test(wt.readyState),t0||wt.addEventListener("DOMContentLoaded",Nk));function zG(t){Ei&&(t0?setTimeout(t,0):kk.push(t))}function vh(t){const{tag:e,attributes:n={},children:r=[]}=t;return typeof t=="string"?Pk(t):"<".concat(e," ").concat(FG(n),">").concat(r.map(vh).join(""),"")}function Uw(t,e,n){if(t&&t[e]&&t[e][n])return{prefix:e,iconName:n,icon:t[e][n]}}var Qg=function(e,n,r,a){var i=Object.keys(e),s=i.length,o=n,l,u,c;for(r===void 0?(l=1,c=e[i[0]]):(l=0,c=r);l=55296&&a<=56319&&n=55296&&r<=56319&&n>e+1&&(a=t.charCodeAt(e+1),a>=56320&&a<=57343)?(r-55296)*1024+a-56320+65536:r}function Vw(t){return Object.keys(t).reduce((e,n)=>{const r=t[n];return!!r.icon?e[r.iconName]=r.icon:e[n]=r,e},{})}function i_(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const{skipHooks:r=!1}=n,a=Vw(e);typeof Sa.hooks.addPack=="function"&&!r?Sa.hooks.addPack(t,Vw(e)):Sa.styles[t]={...Sa.styles[t]||{},...a},t==="fas"&&i_("fa",e)}const{styles:Gs,shims:HG}=Sa,WG={[Pt]:Object.values(oo[Pt]),[wr]:Object.values(oo[wr]),[Cr]:Object.values(oo[Cr])};let rb=null,Ok={},Mk={},Lk={},Dk={},Fk={};const $G={[Pt]:Object.keys(so[Pt]),[wr]:Object.keys(so[wr]),[Cr]:Object.keys(so[Cr])};function KG(t){return~kG.indexOf(t)}function JG(t,e){const n=e.split("-"),r=n[0],a=n.slice(1).join("-");return r===t&&a!==""&&!KG(a)?a:null}const Bk=()=>{const t=r=>Qg(Gs,(a,i,s)=>(a[s]=Qg(i,r,{}),a),{});Ok=t((r,a,i)=>(a[3]&&(r[a[3]]=i),a[2]&&a[2].filter(o=>typeof o=="number").forEach(o=>{r[o.toString(16)]=i}),r)),Mk=t((r,a,i)=>(r[i]=i,a[2]&&a[2].filter(o=>typeof o=="string").forEach(o=>{r[o]=i}),r)),Fk=t((r,a,i)=>{const s=a[2];return r[i]=i,s.forEach(o=>{r[o]=i}),r});const e="far"in Gs||Te.autoFetchSvg,n=Qg(HG,(r,a)=>{const i=a[0];let s=a[1];const o=a[2];return s==="far"&&!e&&(s="fas"),typeof i=="string"&&(r.names[i]={prefix:s,iconName:o}),typeof i=="number"&&(r.unicodes[i.toString(16)]={prefix:s,iconName:o}),r},{names:{},unicodes:{}});Lk=n.names,Dk=n.unicodes,rb=bm(Te.styleDefault,{family:Te.familyDefault})};MG(t=>{rb=bm(t.styleDefault,{family:Te.familyDefault})});Bk();function ab(t,e){return(Ok[t]||{})[e]}function YG(t,e){return(Mk[t]||{})[e]}function Hi(t,e){return(Fk[t]||{})[e]}function Uk(t){return Lk[t]||{prefix:null,iconName:null}}function XG(t){const e=Dk[t],n=ab("fas",t);return e||(n?{prefix:"fas",iconName:n}:null)||{prefix:null,iconName:null}}function Es(){return rb}const ib=()=>({prefix:null,iconName:null,rest:[]});function bm(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{family:n=Pt}=e,r=so[n][t],a=Nd[n][t]||Nd[n][r],i=t in Sa.styles?t:null;return a||i||null}const QG={[Pt]:Object.keys(oo[Pt]),[wr]:Object.keys(oo[wr]),[Cr]:Object.keys(oo[Cr])};function xm(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{skipLookups:n=!1}=e,r={[Pt]:"".concat(Te.cssPrefix,"-").concat(Pt),[wr]:"".concat(Te.cssPrefix,"-").concat(wr),[Cr]:"".concat(Te.cssPrefix,"-").concat(Cr)};let a=null,i=Pt;const s=sG.filter(l=>l!==yk);s.forEach(l=>{(t.includes(r[l])||t.some(u=>QG[l].includes(u)))&&(i=l)});const o=t.reduce((l,u)=>{const c=JG(Te.cssPrefix,u);if(Gs[u]?(u=WG[i].includes(u)?CG[i][u]:u,a=u,l.prefix=u):$G[i].indexOf(u)>-1?(a=u,l.prefix=bm(u,{family:i})):c?l.iconName=c:u!==Te.replacementClass&&!s.some(h=>u===r[h])&&l.rest.push(u),!n&&l.prefix&&l.iconName){const h=a==="fa"?Uk(l.iconName):{},f=Hi(l.prefix,l.iconName);h.prefix&&(a=null),l.iconName=h.iconName||f||l.iconName,l.prefix=h.prefix||l.prefix,l.prefix==="far"&&!Gs.far&&Gs.fas&&!Te.autoFetchSvg&&(l.prefix="fas")}return l},ib());return(t.includes("fa-brands")||t.includes("fab"))&&(o.prefix="fab"),(t.includes("fa-duotone")||t.includes("fad"))&&(o.prefix="fad"),!o.prefix&&i===wr&&(Gs.fass||Te.autoFetchSvg)&&(o.prefix="fass",o.iconName=Hi(o.prefix,o.iconName)||o.iconName),!o.prefix&&i===Cr&&(Gs.fasds||Te.autoFetchSvg)&&(o.prefix="fasds",o.iconName=Hi(o.prefix,o.iconName)||o.iconName),(o.prefix==="fa"||a==="fa")&&(o.prefix=Es()||"fas"),o}class ZG{constructor(){this.definitions={}}add(){for(var e=arguments.length,n=new Array(e),r=0;r{this.definitions[i]={...this.definitions[i]||{},...a[i]},i_(i,a[i]);const s=oo[Pt][i];s&&i_(s,a[i]),Bk()})}reset(){this.definitions={}}_pullDefinitions(e,n){const r=n.prefix&&n.iconName&&n.icon?{0:n}:n;return Object.keys(r).map(a=>{const{prefix:i,iconName:s,icon:o}=r[a],l=o[2];e[i]||(e[i]={}),l.length>0&&l.forEach(u=>{typeof u=="string"&&(e[i][u]=o)}),e[i][s]=o}),e}}let jw=[],El={};const Dl={},eH=Object.keys(Dl);function tH(t,e){let{mixoutsTo:n}=e;return jw=t,El={},Object.keys(Dl).forEach(r=>{eH.indexOf(r)===-1&&delete Dl[r]}),jw.forEach(r=>{const a=r.mixout?r.mixout():{};if(Object.keys(a).forEach(i=>{typeof a[i]=="function"&&(n[i]=a[i]),typeof a[i]=="object"&&Object.keys(a[i]).forEach(s=>{n[i]||(n[i]={}),n[i][s]=a[i][s]})}),r.hooks){const i=r.hooks();Object.keys(i).forEach(s=>{El[s]||(El[s]=[]),El[s].push(i[s])})}r.provides&&r.provides(Dl)}),n}function s_(t,e){for(var n=arguments.length,r=new Array(n>2?n-2:0),a=2;a{e=s.apply(null,[e,...r])}),e}function Co(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r{i.apply(null,n)})}function bs(){const t=arguments[0],e=Array.prototype.slice.call(arguments,1);return Dl[t]?Dl[t].apply(null,e):void 0}function o_(t){t.prefix==="fa"&&(t.prefix="fas");let{iconName:e}=t;const n=t.prefix||Es();if(e)return e=Hi(n,e)||e,Uw(Vk.definitions,n,e)||Uw(Sa.styles,n,e)}const Vk=new ZG,nH=()=>{Te.autoReplaceSvg=!1,Te.observeMutations=!1,Co("noAuto")},rH={i2svg:function(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return Ei?(Co("beforeI2svg",t),bs("pseudoElements2svg",t),bs("i2svg",t)):Promise.reject(new Error("Operation requires a DOM of some kind."))},watch:function(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const{autoReplaceSvgRoot:e}=t;Te.autoReplaceSvg===!1&&(Te.autoReplaceSvg=!0),Te.observeMutations=!0,zG(()=>{iH({autoReplaceSvgRoot:e}),Co("watch",t)})}},aH={icon:t=>{if(t===null)return null;if(typeof t=="object"&&t.prefix&&t.iconName)return{prefix:t.prefix,iconName:Hi(t.prefix,t.iconName)||t.iconName};if(Array.isArray(t)&&t.length===2){const e=t[1].indexOf("fa-")===0?t[1].slice(3):t[1],n=bm(t[0]);return{prefix:n,iconName:Hi(n,e)||e}}if(typeof t=="string"&&(t.indexOf("".concat(Te.cssPrefix,"-"))>-1||t.match(AG))){const e=xm(t.split(" "),{skipLookups:!0});return{prefix:e.prefix||Es(),iconName:Hi(e.prefix,e.iconName)||e.iconName}}if(typeof t=="string"){const e=Es();return{prefix:e,iconName:Hi(e,t)||t}}}},Or={noAuto:nH,config:Te,dom:rH,parse:aH,library:Vk,findIconDefinition:o_,toHtml:vh},iH=function(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const{autoReplaceSvgRoot:e=wt}=t;(Object.keys(Sa.styles).length>0||Te.autoFetchSvg)&&Ei&&Te.autoReplaceSvg&&Or.dom.i2svg({node:e})};function Sm(t,e){return Object.defineProperty(t,"abstract",{get:e}),Object.defineProperty(t,"html",{get:function(){return t.abstract.map(n=>vh(n))}}),Object.defineProperty(t,"node",{get:function(){if(!Ei)return;const n=wt.createElement("div");return n.innerHTML=t.html,n.children}}),t}function sH(t){let{children:e,main:n,mask:r,attributes:a,styles:i,transform:s}=t;if(nb(s)&&n.found&&!r.found){const{width:o,height:l}=n,u={x:o/l/2,y:.5};a.style=Em({...i,"transform-origin":"".concat(u.x+s.x/16,"em ").concat(u.y+s.y/16,"em")})}return[{tag:"svg",attributes:a,children:e}]}function oH(t){let{prefix:e,iconName:n,children:r,attributes:a,symbol:i}=t;const s=i===!0?"".concat(e,"-").concat(Te.cssPrefix,"-").concat(n):i;return[{tag:"svg",attributes:{style:"display: none;"},children:[{tag:"symbol",attributes:{...a,id:s},children:r}]}]}function sb(t){const{icons:{main:e,mask:n},prefix:r,iconName:a,transform:i,symbol:s,title:o,maskId:l,titleId:u,extra:c,watchable:h=!1}=t,{width:f,height:p}=n.found?n:e,g=r==="fak",m=[Te.replacementClass,a?"".concat(Te.cssPrefix,"-").concat(a):""].filter(j=>c.classes.indexOf(j)===-1).filter(j=>j!==""||!!j).concat(c.classes).join(" ");let _={children:[],attributes:{...c.attributes,"data-prefix":r,"data-icon":a,class:m,role:c.attributes.role||"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 ".concat(f," ").concat(p)}};const x=g&&!~c.classes.indexOf("fa-fw")?{width:"".concat(f/p*16*.0625,"em")}:{};h&&(_.attributes[wo]=""),o&&(_.children.push({tag:"title",attributes:{id:_.attributes["aria-labelledby"]||"title-".concat(u||Od())},children:[o]}),delete _.attributes.title);const E={..._,prefix:r,iconName:a,main:e,mask:n,maskId:l,transform:i,symbol:s,styles:{...x,...c.styles}},{children:y,attributes:I}=n.found&&e.found?bs("generateAbstractMask",E)||{children:[],attributes:{}}:bs("generateAbstractIcon",E)||{children:[],attributes:{}};return E.children=y,E.attributes=I,s?oH(E):sH(E)}function zw(t){const{content:e,width:n,height:r,transform:a,title:i,extra:s,watchable:o=!1}=t,l={...s.attributes,...i?{title:i}:{},class:s.classes.join(" ")};o&&(l[wo]="");const u={...s.styles};nb(a)&&(u.transform=UG({transform:a,startCentered:!0,width:n,height:r}),u["-webkit-transform"]=u.transform);const c=Em(u);c.length>0&&(l.style=c);const h=[];return h.push({tag:"span",attributes:l,children:[e]}),i&&h.push({tag:"span",attributes:{class:"sr-only"},children:[i]}),h}function lH(t){const{content:e,title:n,extra:r}=t,a={...r.attributes,...n?{title:n}:{},class:r.classes.join(" ")},i=Em(r.styles);i.length>0&&(a.style=i);const s=[];return s.push({tag:"span",attributes:a,children:[e]}),n&&s.push({tag:"span",attributes:{class:"sr-only"},children:[n]}),s}const{styles:Zg}=Sa;function l_(t){const e=t[0],n=t[1],[r]=t.slice(4);let a=null;return Array.isArray(r)?a={tag:"g",attributes:{class:"".concat(Te.cssPrefix,"-").concat(Yg.GROUP)},children:[{tag:"path",attributes:{class:"".concat(Te.cssPrefix,"-").concat(Yg.SECONDARY),fill:"currentColor",d:r[0]}},{tag:"path",attributes:{class:"".concat(Te.cssPrefix,"-").concat(Yg.PRIMARY),fill:"currentColor",d:r[1]}}]}:a={tag:"path",attributes:{fill:"currentColor",d:r}},{found:!0,width:e,height:n,icon:a}}const uH={found:!1,width:512,height:512};function cH(t,e){!Tk&&!Te.showMissingIcons&&t&&console.error('Icon with name "'.concat(t,'" and prefix "').concat(e,'" is missing.'))}function u_(t,e){let n=e;return e==="fa"&&Te.styleDefault!==null&&(e=Es()),new Promise((r,a)=>{if(n==="fa"){const i=Uk(t)||{};t=i.iconName||t,e=i.prefix||e}if(t&&e&&Zg[e]&&Zg[e][t]){const i=Zg[e][t];return r(l_(i))}cH(t,e),r({...uH,icon:Te.showMissingIcons&&t?bs("missingIconAbstract")||{}:{}})})}const qw=()=>{},c_=Te.measurePerformance&&pf&&pf.mark&&pf.measure?pf:{mark:qw,measure:qw},yc='FA "6.6.0"',dH=t=>(c_.mark("".concat(yc," ").concat(t," begins")),()=>jk(t)),jk=t=>{c_.mark("".concat(yc," ").concat(t," ends")),c_.measure("".concat(yc," ").concat(t),"".concat(yc," ").concat(t," begins"),"".concat(yc," ").concat(t," ends"))};var ob={begin:dH,end:jk};const Jf=()=>{};function Gw(t){return typeof(t.getAttribute?t.getAttribute(wo):null)=="string"}function hH(t){const e=t.getAttribute?t.getAttribute(ZE):null,n=t.getAttribute?t.getAttribute(eb):null;return e&&n}function fH(t){return t&&t.classList&&t.classList.contains&&t.classList.contains(Te.replacementClass)}function pH(){return Te.autoReplaceSvg===!0?Yf.replace:Yf[Te.autoReplaceSvg]||Yf.replace}function mH(t){return wt.createElementNS("http://www.w3.org/2000/svg",t)}function gH(t){return wt.createElement(t)}function zk(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{ceFn:n=t.tag==="svg"?mH:gH}=e;if(typeof t=="string")return wt.createTextNode(t);const r=n(t.tag);return Object.keys(t.attributes||[]).forEach(function(i){r.setAttribute(i,t.attributes[i])}),(t.children||[]).forEach(function(i){r.appendChild(zk(i,{ceFn:n}))}),r}function vH(t){let e=" ".concat(t.outerHTML," ");return e="".concat(e,"Font Awesome fontawesome.com "),e}const Yf={replace:function(t){const e=t[0];if(e.parentNode)if(t[1].forEach(n=>{e.parentNode.insertBefore(zk(n),e)}),e.getAttribute(wo)===null&&Te.keepOriginalSource){let n=wt.createComment(vH(e));e.parentNode.replaceChild(n,e)}else e.remove()},nest:function(t){const e=t[0],n=t[1];if(~tb(e).indexOf(Te.replacementClass))return Yf.replace(t);const r=new RegExp("".concat(Te.cssPrefix,"-.*"));if(delete n[0].attributes.id,n[0].attributes.class){const i=n[0].attributes.class.split(" ").reduce((s,o)=>(o===Te.replacementClass||o.match(r)?s.toSvg.push(o):s.toNode.push(o),s),{toNode:[],toSvg:[]});n[0].attributes.class=i.toSvg.join(" "),i.toNode.length===0?e.removeAttribute("class"):e.setAttribute("class",i.toNode.join(" "))}const a=n.map(i=>vh(i)).join(` `);e.setAttribute(wo,""),e.innerHTML=a}};function Hw(t){t()}function qk(t,e){const n=typeof e=="function"?e:Jf;if(t.length===0)n();else{let r=Hw;Te.mutateApproach===TG&&(r=ys.requestAnimationFrame||Hw),r(()=>{const a=pH(),i=ob.begin("mutate");t.map(a),i(),n()})}}let lb=!1;function Gk(){lb=!0}function d_(){lb=!1}let n0=null;function Ww(t){if(!Mw||!Te.observeMutations)return;const{treeCallback:e=Jf,nodeCallback:n=Jf,pseudoElementsCallback:r=Jf,observeMutationsRoot:a=wt}=t;n0=new Mw(i=>{if(lb)return;const s=Es();wu(i).forEach(o=>{if(o.type==="childList"&&o.addedNodes.length>0&&!Gw(o.addedNodes[0])&&(Te.searchPseudoElements&&r(o.target),e(o.target)),o.type==="attributes"&&o.target.parentNode&&Te.searchPseudoElements&&r(o.target.parentNode),o.type==="attributes"&&Gw(o.target)&&~RG.indexOf(o.attributeName))if(o.attributeName==="class"&&hH(o.target)){const{prefix:l,iconName:u}=xm(tb(o.target));o.target.setAttribute(ZE,l||s),u&&o.target.setAttribute(eb,u)}else fH(o.target)&&n(o.target)})}),Ei&&n0.observe(a,{childList:!0,attributes:!0,characterData:!0,subtree:!0})}function _H(){n0&&n0.disconnect()}function yH(t){const e=t.getAttribute("style");let n=[];return e&&(n=e.split(";").reduce((r,a)=>{const i=a.split(":"),s=i[0],o=i.slice(1);return s&&o.length>0&&(r[s]=o.join(":").trim()),r},{})),n}function EH(t){const e=t.getAttribute("data-prefix"),n=t.getAttribute("data-icon"),r=t.innerText!==void 0?t.innerText.trim():"";let a=xm(tb(t));return a.prefix||(a.prefix=Es()),e&&n&&(a.prefix=e,a.iconName=n),a.iconName&&a.prefix||(a.prefix&&r.length>0&&(a.iconName=YG(a.prefix,t.innerText)||ab(a.prefix,a_(t.innerText))),!a.iconName&&Te.autoFetchSvg&&t.firstChild&&t.firstChild.nodeType===Node.TEXT_NODE&&(a.iconName=t.firstChild.data)),a}function bH(t){const e=wu(t.attributes).reduce((a,i)=>(a.name!=="class"&&a.name!=="style"&&(a[i.name]=i.value),a),{}),n=t.getAttribute("title"),r=t.getAttribute("data-fa-title-id");return Te.autoA11y&&(n?e["aria-labelledby"]="".concat(Te.replacementClass,"-title-").concat(r||Od()):(e["aria-hidden"]="true",e.focusable="false")),e}function xH(){return{iconName:null,title:null,titleId:null,prefix:null,transform:xa,symbol:!1,mask:{iconName:null,prefix:null,rest:[]},maskId:null,extra:{classes:[],styles:{},attributes:{}}}}function $w(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{styleParser:!0};const{iconName:n,prefix:r,rest:a}=EH(t),i=bH(t),s=s_("parseNodeAttributes",{},t);let o=e.styleParser?yH(t):[];return{iconName:n,title:t.getAttribute("title"),titleId:t.getAttribute("data-fa-title-id"),prefix:r,transform:xa,mask:{iconName:null,prefix:null,rest:[]},maskId:null,symbol:!1,extra:{classes:a,styles:o,attributes:i},...s}}const{styles:SH}=Sa;function Hk(t){const e=Te.autoReplaceSvg==="nest"?$w(t,{styleParser:!1}):$w(t);return~e.extra.classes.indexOf(Ak)?bs("generateLayersText",t,e):bs("generateSvgReplacementMutation",t,e)}let Oa=new Set;wk.map(t=>{Oa.add("fa-".concat(t))});Object.keys(so[Pt]).map(Oa.add.bind(Oa));Object.keys(so[wr]).map(Oa.add.bind(Oa));Object.keys(so[Cr]).map(Oa.add.bind(Oa));Oa=[...Oa];function Kw(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(!Ei)return Promise.resolve();const n=wt.documentElement.classList,r=c=>n.add("".concat(Fw,"-").concat(c)),a=c=>n.remove("".concat(Fw,"-").concat(c)),i=Te.autoFetchSvg?Oa:wk.map(c=>"fa-".concat(c)).concat(Object.keys(SH));i.includes("fa")||i.push("fa");const s=[".".concat(Ak,":not([").concat(wo,"])")].concat(i.map(c=>".".concat(c,":not([").concat(wo,"])"))).join(", ");if(s.length===0)return Promise.resolve();let o=[];try{o=wu(t.querySelectorAll(s))}catch{}if(o.length>0)r("pending"),a("complete");else return Promise.resolve();const l=ob.begin("onTree"),u=o.reduce((c,h)=>{try{const f=Hk(h);f&&c.push(f)}catch(f){Tk||f.name==="MissingIcon"&&console.error(f)}return c},[]);return new Promise((c,h)=>{Promise.all(u).then(f=>{qk(f,()=>{r("active"),r("complete"),a("pending"),typeof e=="function"&&e(),l(),c()})}).catch(f=>{l(),h(f)})})}function TH(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;Hk(t).then(n=>{n&&qk([n],e)})}function wH(t){return function(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const r=(e||{}).icon?e:o_(e||{});let{mask:a}=n;return a&&(a=(a||{}).icon?a:o_(a||{})),t(r,{...n,mask:a})}}const CH=function(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{transform:n=xa,symbol:r=!1,mask:a=null,maskId:i=null,title:s=null,titleId:o=null,classes:l=[],attributes:u={},styles:c={}}=e;if(!t)return;const{prefix:h,iconName:f,icon:p}=t;return Sm({type:"icon",...t},()=>(Co("beforeDOMElementCreation",{iconDefinition:t,params:e}),Te.autoA11y&&(s?u["aria-labelledby"]="".concat(Te.replacementClass,"-title-").concat(o||Od()):(u["aria-hidden"]="true",u.focusable="false")),sb({icons:{main:l_(p),mask:a?l_(a.icon):{found:!1,width:null,height:null,icon:{}}},prefix:h,iconName:f,transform:{...xa,...n},symbol:r,title:s,maskId:i,titleId:o,extra:{attributes:u,styles:c,classes:l}})))};var AH={mixout(){return{icon:wH(CH)}},hooks(){return{mutationObserverCallbacks(t){return t.treeCallback=Kw,t.nodeCallback=TH,t}}},provides(t){t.i2svg=function(e){const{node:n=wt,callback:r=()=>{}}=e;return Kw(n,r)},t.generateSvgReplacementMutation=function(e,n){const{iconName:r,title:a,titleId:i,prefix:s,transform:o,symbol:l,mask:u,maskId:c,extra:h}=n;return new Promise((f,p)=>{Promise.all([u_(r,s),u.iconName?u_(u.iconName,u.prefix):Promise.resolve({found:!1,width:512,height:512,icon:{}})]).then(g=>{let[m,_]=g;f([e,sb({icons:{main:m,mask:_},prefix:s,iconName:r,transform:o,symbol:l,maskId:c,title:a,titleId:i,extra:h,watchable:!0})])}).catch(p)})},t.generateAbstractIcon=function(e){let{children:n,attributes:r,main:a,transform:i,styles:s}=e;const o=Em(s);o.length>0&&(r.style=o);let l;return nb(i)&&(l=bs("generateAbstractTransformGrouping",{main:a,transform:i,containerWidth:a.width,iconWidth:a.width})),n.push(l||a.icon),{children:n,attributes:r}}}},IH={mixout(){return{layer(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{classes:n=[]}=e;return Sm({type:"layer"},()=>{Co("beforeDOMElementCreation",{assembler:t,params:e});let r=[];return t(a=>{Array.isArray(a)?a.map(i=>{r=r.concat(i.abstract)}):r=r.concat(a.abstract)}),[{tag:"span",attributes:{class:["".concat(Te.cssPrefix,"-layers"),...n].join(" ")},children:r}]})}}}},PH={mixout(){return{counter(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{title:n=null,classes:r=[],attributes:a={},styles:i={}}=e;return Sm({type:"counter",content:t},()=>(Co("beforeDOMElementCreation",{content:t,params:e}),lH({content:t.toString(),title:n,extra:{attributes:a,styles:i,classes:["".concat(Te.cssPrefix,"-layers-counter"),...r]}})))}}}},RH={mixout(){return{text(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{transform:n=xa,title:r=null,classes:a=[],attributes:i={},styles:s={}}=e;return Sm({type:"text",content:t},()=>(Co("beforeDOMElementCreation",{content:t,params:e}),zw({content:t,transform:{...xa,...n},title:r,extra:{attributes:i,styles:s,classes:["".concat(Te.cssPrefix,"-layers-text"),...a]}})))}}},provides(t){t.generateLayersText=function(e,n){const{title:r,transform:a,extra:i}=n;let s=null,o=null;if(_k){const l=parseInt(getComputedStyle(e).fontSize,10),u=e.getBoundingClientRect();s=u.width/l,o=u.height/l}return Te.autoA11y&&!r&&(i.attributes["aria-hidden"]="true"),Promise.resolve([e,zw({content:e.innerHTML,width:s,height:o,transform:a,title:r,extra:i,watchable:!0})])}}};const kH=new RegExp('"',"ug"),Jw=[1105920,1112319],Yw={FontAwesome:{normal:"fas",400:"fas"},...hG,...dG,...EG},h_=Object.keys(Yw).reduce((t,e)=>(t[e.toLowerCase()]=Yw[e],t),{}),NH=Object.keys(h_).reduce((t,e)=>{const n=h_[e];return t[e]=n[900]||[...Object.entries(n)][0][1],t},{});function OH(t){const e=t.replace(kH,""),n=GG(e,0),r=n>=Jw[0]&&n<=Jw[1],a=e.length===2?e[0]===e[1]:!1;return{value:a_(a?e[0]:e),isSecondary:r||a}}function MH(t,e){const n=t.replace(/^['"]|['"]$/g,"").toLowerCase(),r=parseInt(e),a=isNaN(r)?"normal":r;return(h_[n]||{})[a]||NH[n]}function Xw(t,e){const n="".concat(SG).concat(e.replace(":","-"));return new Promise((r,a)=>{if(t.getAttribute(n)!==null)return r();const s=wu(t.children).filter(f=>f.getAttribute(e_)===e)[0],o=ys.getComputedStyle(t,e),l=o.getPropertyValue("font-family"),u=l.match(IG),c=o.getPropertyValue("font-weight"),h=o.getPropertyValue("content");if(s&&!u)return t.removeChild(s),r();if(u&&h!=="none"&&h!==""){const f=o.getPropertyValue("content");let p=MH(l,c);const{value:g,isSecondary:m}=OH(f),_=u[0].startsWith("FontAwesome");let x=ab(p,g),E=x;if(_){const y=XG(g);y.iconName&&y.prefix&&(x=y.iconName,p=y.prefix)}if(x&&!m&&(!s||s.getAttribute(ZE)!==p||s.getAttribute(eb)!==E)){t.setAttribute(n,E),s&&t.removeChild(s);const y=xH(),{extra:I}=y;I.attributes[e_]=e,u_(x,p).then(j=>{const G=sb({...y,icons:{main:j,mask:ib()},prefix:p,iconName:E,extra:I,watchable:!0}),T=wt.createElementNS("http://www.w3.org/2000/svg","svg");e==="::before"?t.insertBefore(T,t.firstChild):t.appendChild(T),T.outerHTML=G.map(S=>vh(S)).join(` `),t.removeAttribute(n),r()}).catch(a)}else r()}else r()})}function LH(t){return Promise.all([Xw(t,"::before"),Xw(t,"::after")])}function DH(t){return t.parentNode!==document.head&&!~wG.indexOf(t.tagName.toUpperCase())&&!t.getAttribute(e_)&&(!t.parentNode||t.parentNode.tagName!=="svg")}function Qw(t){if(Ei)return new Promise((e,n)=>{const r=wu(t.querySelectorAll("*")).filter(DH).map(LH),a=ob.begin("searchPseudoElements");Gk(),Promise.all(r).then(()=>{a(),d_(),e()}).catch(()=>{a(),d_(),n()})})}var FH={hooks(){return{mutationObserverCallbacks(t){return t.pseudoElementsCallback=Qw,t}}},provides(t){t.pseudoElements2svg=function(e){const{node:n=wt}=e;Te.searchPseudoElements&&Qw(n)}}};let Zw=!1;var BH={mixout(){return{dom:{unwatch(){Gk(),Zw=!0}}}},hooks(){return{bootstrap(){Ww(s_("mutationObserverCallbacks",{}))},noAuto(){_H()},watch(t){const{observeMutationsRoot:e}=t;Zw?d_():Ww(s_("mutationObserverCallbacks",{observeMutationsRoot:e}))}}}};const e2=t=>{let e={size:16,x:0,y:0,flipX:!1,flipY:!1,rotate:0};return t.toLowerCase().split(" ").reduce((n,r)=>{const a=r.toLowerCase().split("-"),i=a[0];let s=a.slice(1).join("-");if(i&&s==="h")return n.flipX=!0,n;if(i&&s==="v")return n.flipY=!0,n;if(s=parseFloat(s),isNaN(s))return n;switch(i){case"grow":n.size=n.size+s;break;case"shrink":n.size=n.size-s;break;case"left":n.x=n.x-s;break;case"right":n.x=n.x+s;break;case"up":n.y=n.y-s;break;case"down":n.y=n.y+s;break;case"rotate":n.rotate=n.rotate+s;break}return n},e)};var UH={mixout(){return{parse:{transform:t=>e2(t)}}},hooks(){return{parseNodeAttributes(t,e){const n=e.getAttribute("data-fa-transform");return n&&(t.transform=e2(n)),t}}},provides(t){t.generateAbstractTransformGrouping=function(e){let{main:n,transform:r,containerWidth:a,iconWidth:i}=e;const s={transform:"translate(".concat(a/2," 256)")},o="translate(".concat(r.x*32,", ").concat(r.y*32,") "),l="scale(".concat(r.size/16*(r.flipX?-1:1),", ").concat(r.size/16*(r.flipY?-1:1),") "),u="rotate(".concat(r.rotate," 0 0)"),c={transform:"".concat(o," ").concat(l," ").concat(u)},h={transform:"translate(".concat(i/2*-1," -256)")},f={outer:s,inner:c,path:h};return{tag:"g",attributes:{...f.outer},children:[{tag:"g",attributes:{...f.inner},children:[{tag:n.icon.tag,children:n.icon.children,attributes:{...n.icon.attributes,...f.path}}]}]}}}};const ev={x:0,y:0,width:"100%",height:"100%"};function t2(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return t.attributes&&(t.attributes.fill||e)&&(t.attributes.fill="black"),t}function VH(t){return t.tag==="g"?t.children:[t]}var jH={hooks(){return{parseNodeAttributes(t,e){const n=e.getAttribute("data-fa-mask"),r=n?xm(n.split(" ").map(a=>a.trim())):ib();return r.prefix||(r.prefix=Es()),t.mask=r,t.maskId=e.getAttribute("data-fa-mask-id"),t}}},provides(t){t.generateAbstractMask=function(e){let{children:n,attributes:r,main:a,mask:i,maskId:s,transform:o}=e;const{width:l,icon:u}=a,{width:c,icon:h}=i,f=BG({transform:o,containerWidth:c,iconWidth:l}),p={tag:"rect",attributes:{...ev,fill:"white"}},g=u.children?{children:u.children.map(t2)}:{},m={tag:"g",attributes:{...f.inner},children:[t2({tag:u.tag,attributes:{...u.attributes,...f.path},...g})]},_={tag:"g",attributes:{...f.outer},children:[m]},x="mask-".concat(s||Od()),E="clip-".concat(s||Od()),y={tag:"mask",attributes:{...ev,id:x,maskUnits:"userSpaceOnUse",maskContentUnits:"userSpaceOnUse"},children:[p,_]},I={tag:"defs",children:[{tag:"clipPath",attributes:{id:E},children:VH(h)},y]};return n.push(I,{tag:"rect",attributes:{fill:"currentColor","clip-path":"url(#".concat(E,")"),mask:"url(#".concat(x,")"),...ev}}),{children:n,attributes:r}}}},zH={provides(t){let e=!1;ys.matchMedia&&(e=ys.matchMedia("(prefers-reduced-motion: reduce)").matches),t.missingIconAbstract=function(){const n=[],r={fill:"currentColor"},a={attributeType:"XML",repeatCount:"indefinite",dur:"2s"};n.push({tag:"path",attributes:{...r,d:"M156.5,447.7l-12.6,29.5c-18.7-9.5-35.9-21.2-51.5-34.9l22.7-22.7C127.6,430.5,141.5,440,156.5,447.7z M40.6,272H8.5 c1.4,21.2,5.4,41.7,11.7,61.1L50,321.2C45.1,305.5,41.8,289,40.6,272z M40.6,240c1.4-18.8,5.2-37,11.1-54.1l-29.5-12.6 C14.7,194.3,10,216.7,8.5,240H40.6z M64.3,156.5c7.8-14.9,17.2-28.8,28.1-41.5L69.7,92.3c-13.7,15.6-25.5,32.8-34.9,51.5 L64.3,156.5z M397,419.6c-13.9,12-29.4,22.3-46.1,30.4l11.9,29.8c20.7-9.9,39.8-22.6,56.9-37.6L397,419.6z M115,92.4 c13.9-12,29.4-22.3,46.1-30.4l-11.9-29.8c-20.7,9.9-39.8,22.6-56.8,37.6L115,92.4z M447.7,355.5c-7.8,14.9-17.2,28.8-28.1,41.5 l22.7,22.7c13.7-15.6,25.5-32.9,34.9-51.5L447.7,355.5z M471.4,272c-1.4,18.8-5.2,37-11.1,54.1l29.5,12.6 c7.5-21.1,12.2-43.5,13.6-66.8H471.4z M321.2,462c-15.7,5-32.2,8.2-49.2,9.4v32.1c21.2-1.4,41.7-5.4,61.1-11.7L321.2,462z M240,471.4c-18.8-1.4-37-5.2-54.1-11.1l-12.6,29.5c21.1,7.5,43.5,12.2,66.8,13.6V471.4z M462,190.8c5,15.7,8.2,32.2,9.4,49.2h32.1 c-1.4-21.2-5.4-41.7-11.7-61.1L462,190.8z M92.4,397c-12-13.9-22.3-29.4-30.4-46.1l-29.8,11.9c9.9,20.7,22.6,39.8,37.6,56.9 L92.4,397z M272,40.6c18.8,1.4,36.9,5.2,54.1,11.1l12.6-29.5C317.7,14.7,295.3,10,272,8.5V40.6z M190.8,50 c15.7-5,32.2-8.2,49.2-9.4V8.5c-21.2,1.4-41.7,5.4-61.1,11.7L190.8,50z M442.3,92.3L419.6,115c12,13.9,22.3,29.4,30.5,46.1 l29.8-11.9C470,128.5,457.3,109.4,442.3,92.3z M397,92.4l22.7-22.7c-15.6-13.7-32.8-25.5-51.5-34.9l-12.6,29.5 C370.4,72.1,384.4,81.5,397,92.4z"}});const i={...a,attributeName:"opacity"},s={tag:"circle",attributes:{...r,cx:"256",cy:"364",r:"28"},children:[]};return e||s.children.push({tag:"animate",attributes:{...a,attributeName:"r",values:"28;14;28;28;14;28;"}},{tag:"animate",attributes:{...i,values:"1;0;1;1;0;1;"}}),n.push(s),n.push({tag:"path",attributes:{...r,opacity:"1",d:"M263.7,312h-16c-6.6,0-12-5.4-12-12c0-71,77.4-63.9,77.4-107.8c0-20-17.8-40.2-57.4-40.2c-29.1,0-44.3,9.6-59.2,28.7 c-3.9,5-11.1,6-16.2,2.4l-13.1-9.2c-5.6-3.9-6.9-11.8-2.6-17.2c21.2-27.2,46.4-44.7,91.2-44.7c52.3,0,97.4,29.8,97.4,80.2 c0,67.6-77.4,63.5-77.4,107.8C275.7,306.6,270.3,312,263.7,312z"},children:e?[]:[{tag:"animate",attributes:{...i,values:"1;0;0;0;0;1;"}}]}),e||n.push({tag:"path",attributes:{...r,opacity:"0",d:"M232.5,134.5l7,168c0.3,6.4,5.6,11.5,12,11.5h9c6.4,0,11.7-5.1,12-11.5l7-168c0.3-6.8-5.2-12.5-12-12.5h-23 C237.7,122,232.2,127.7,232.5,134.5z"},children:[{tag:"animate",attributes:{...i,values:"0;0;1;1;0;0;"}}]}),{tag:"g",attributes:{class:"missing"},children:n}}}},qH={hooks(){return{parseNodeAttributes(t,e){const n=e.getAttribute("data-fa-symbol"),r=n===null?!1:n===""?!0:n;return t.symbol=r,t}}}},GH=[jG,AH,IH,PH,RH,FH,BH,UH,jH,zH,qH];tH(GH,{mixoutsTo:Or});Or.noAuto;Or.config;Or.library;Or.dom;const f_=Or.parse;Or.findIconDefinition;Or.toHtml;const HH=Or.icon;Or.layer;Or.text;Or.counter;var Wk={exports:{}},WH="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",$H=WH,KH=$H;function $k(){}function Kk(){}Kk.resetWarningCache=$k;var JH=function(){function t(r,a,i,s,o,l){if(l!==KH){var u=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw u.name="Invariant Violation",u}}t.isRequired=t;function e(){return t}var n={array:t,bigint:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:e,element:t,elementType:t,instanceOf:e,node:t,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e,checkPropTypes:Kk,resetWarningCache:$k};return n.PropTypes=n,n};Wk.exports=JH();var YH=Wk.exports;const He=yC(YH);function n2(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),n.push.apply(n,r)}return n}function _a(t){for(var e=1;e=0)&&(n[a]=t[a]);return n}function QH(t,e){if(t==null)return{};var n=XH(t,e),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(a=0;a=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function p_(t){return ZH(t)||eW(t)||tW(t)||nW()}function ZH(t){if(Array.isArray(t))return m_(t)}function eW(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function tW(t,e){if(t){if(typeof t=="string")return m_(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return m_(t,e)}}function m_(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n2&&arguments[2]!==void 0?arguments[2]:{};if(typeof e=="string")return e;var r=(e.children||[]).map(function(l){return Yk(t,l)}),a=Object.keys(e.attributes||{}).reduce(function(l,u){var c=e.attributes[u];switch(u){case"class":l.attrs.className=c,delete e.attributes.class;break;case"style":l.attrs.style=oW(c);break;default:u.indexOf("aria-")===0||u.indexOf("data-")===0?l.attrs[u.toLowerCase()]=c:l.attrs[Jk(u)]=c}return l},{attrs:{}}),i=n.style,s=i===void 0?{}:i,o=QH(n,iW);return a.attrs.style=_a(_a({},a.attrs.style),s),t.apply(void 0,[e.tag,_a(_a({},a.attrs),o)].concat(p_(r)))}var Xk=!1;try{Xk=!0}catch{}function lW(){if(!Xk&&console&&typeof console.error=="function"){var t;(t=console).error.apply(t,arguments)}}function r2(t){if(t&&r0(t)==="object"&&t.prefix&&t.iconName&&t.icon)return t;if(f_.icon)return f_.icon(t);if(t===null)return null;if(t&&r0(t)==="object"&&t.prefix&&t.iconName)return t;if(Array.isArray(t)&&t.length===2)return{prefix:t[0],iconName:t[1]};if(typeof t=="string")return{prefix:"fas",iconName:t}}function tv(t,e){return Array.isArray(e)&&e.length>0||!Array.isArray(e)&&e?bl({},t,e):{}}var a2={border:!1,className:"",mask:null,maskId:null,fixedWidth:!1,inverse:!1,flip:!1,icon:null,listItem:!1,pull:null,pulse:!1,rotation:null,size:null,spin:!1,spinPulse:!1,spinReverse:!1,beat:!1,fade:!1,beatFade:!1,bounce:!1,shake:!1,symbol:!1,title:"",titleId:null,transform:null,swapOpacity:!1},Bo=je.forwardRef(function(t,e){var n=_a(_a({},a2),t),r=n.icon,a=n.mask,i=n.symbol,s=n.className,o=n.title,l=n.titleId,u=n.maskId,c=r2(r),h=tv("classes",[].concat(p_(rW(n)),p_((s||"").split(" ")))),f=tv("transform",typeof n.transform=="string"?f_.transform(n.transform):n.transform),p=tv("mask",r2(a)),g=HH(c,_a(_a(_a(_a({},h),f),p),{},{symbol:i,title:o,titleId:l,maskId:u}));if(!g)return lW("Could not find icon",c),null;var m=g.abstract,_={ref:e};return Object.keys(n).forEach(function(x){a2.hasOwnProperty(x)||(_[x]=n[x])}),uW(m[0],_)});Bo.displayName="FontAwesomeIcon";Bo.propTypes={beat:He.bool,border:He.bool,beatFade:He.bool,bounce:He.bool,className:He.string,fade:He.bool,flash:He.bool,mask:He.oneOfType([He.object,He.array,He.string]),maskId:He.string,fixedWidth:He.bool,inverse:He.bool,flip:He.oneOf([!0,!1,"horizontal","vertical","both"]),icon:He.oneOfType([He.object,He.array,He.string]),listItem:He.bool,pull:He.oneOf(["right","left"]),pulse:He.bool,rotation:He.oneOf([0,90,180,270]),shake:He.bool,size:He.oneOf(["2xs","xs","sm","lg","xl","2xl","1x","2x","3x","4x","5x","6x","7x","8x","9x","10x"]),spin:He.bool,spinPulse:He.bool,spinReverse:He.bool,symbol:He.oneOfType([He.bool,He.string]),title:He.string,titleId:He.string,transform:He.oneOfType([He.string,He.object]),swapOpacity:He.bool};var uW=Yk.bind(null,je.createElement);const cW=()=>O.jsxs("div",{className:"footer-sm-links-container-out",children:[O.jsx("div",{className:"footer-sm-links-container",children:rG.map(({icon:t,link:e,title:n})=>O.jsx("a",{className:"footer-sm-links",href:e,target:"_blank",children:O.jsx(Bo,{icon:t})},n))}),O.jsx("p",{className:"footer-address",children:Bz})]}),Tm=()=>O.jsxs("div",{className:"footer-container",children:[O.jsx("p",{className:"footer-disclaimer",dangerouslySetInnerHTML:{__html:eG}}),O.jsx("hr",{}),O.jsx(iG,{}),O.jsx("hr",{}),O.jsx(aG,{}),O.jsx("hr",{}),O.jsx(cW,{}),O.jsx("hr",{}),O.jsx("p",{className:"footer-develop",dangerouslySetInnerHTML:{__html:tG}})]}),dW={prefix:"fas",iconName:"eye-slash",icon:[640,512,[],"f070","M38.8 5.1C28.4-3.1 13.3-1.2 5.1 9.2S-1.2 34.7 9.2 42.9l592 464c10.4 8.2 25.5 6.3 33.7-4.1s6.3-25.5-4.1-33.7L525.6 386.7c39.6-40.6 66.4-86.1 79.9-118.4c3.3-7.9 3.3-16.7 0-24.6c-14.9-35.7-46.2-87.7-93-131.1C465.5 68.8 400.8 32 320 32c-68.2 0-125 26.3-169.3 60.8L38.8 5.1zM223.1 149.5C248.6 126.2 282.7 112 320 112c79.5 0 144 64.5 144 144c0 24.9-6.3 48.3-17.4 68.7L408 294.5c8.4-19.3 10.6-41.4 4.8-63.3c-11.1-41.5-47.8-69.4-88.6-71.1c-5.8-.2-9.2 6.1-7.4 11.7c2.1 6.4 3.3 13.2 3.3 20.3c0 10.2-2.4 19.8-6.6 28.3l-90.3-70.8zM373 389.9c-16.4 6.5-34.3 10.1-53 10.1c-79.5 0-144-64.5-144-144c0-6.9 .5-13.6 1.4-20.2L83.1 161.5C60.3 191.2 44 220.8 34.5 243.7c-3.3 7.9-3.3 16.7 0 24.6c14.9 35.7 46.2 87.7 93 131.1C174.5 443.2 239.2 480 320 480c47.8 0 89.9-12.9 126.2-32.5L373 389.9z"]},hW={prefix:"fas",iconName:"eye",icon:[576,512,[128065],"f06e","M288 32c-80.8 0-145.5 36.8-192.6 80.6C48.6 156 17.3 208 2.5 243.7c-3.3 7.9-3.3 16.7 0 24.6C17.3 304 48.6 356 95.4 399.4C142.5 443.2 207.2 480 288 480s145.5-36.8 192.6-80.6c46.8-43.5 78.1-95.4 93-131.1c3.3-7.9 3.3-16.7 0-24.6c-14.9-35.7-46.2-87.7-93-131.1C433.5 68.8 368.8 32 288 32zM144 256a144 144 0 1 1 288 0 144 144 0 1 1 -288 0zm144-64c0 35.3-28.7 64-64 64c-7.1 0-13.9-1.2-20.3-3.3c-5.5-1.8-11.9 1.6-11.7 7.4c.3 6.9 1.3 13.8 3.2 20.7c13.7 51.2 66.4 81.6 117.6 67.9s81.6-66.4 67.9-117.6c-11.1-41.5-47.8-69.4-88.6-71.1c-5.8-.2-9.2 6.1-7.4 11.7c2.1 6.4 3.3 13.2 3.3 20.3z"]},fW={prefix:"fas",iconName:"delete-left",icon:[576,512,[9003,"backspace"],"f55a","M576 128c0-35.3-28.7-64-64-64L205.3 64c-17 0-33.3 6.7-45.3 18.7L9.4 233.4c-6 6-9.4 14.1-9.4 22.6s3.4 16.6 9.4 22.6L160 429.3c12 12 28.3 18.7 45.3 18.7L512 448c35.3 0 64-28.7 64-64l0-256zM271 175c9.4-9.4 24.6-9.4 33.9 0l47 47 47-47c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-47 47 47 47c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-47-47-47 47c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l47-47-47-47c-9.4-9.4-9.4-24.6 0-33.9z"]},pW={prefix:"fas",iconName:"user-large",icon:[512,512,["user-alt"],"f406","M256 288A144 144 0 1 0 256 0a144 144 0 1 0 0 288zm-94.7 32C72.2 320 0 392.2 0 481.3c0 17 13.8 30.7 30.7 30.7l450.6 0c17 0 30.7-13.8 30.7-30.7C512 392.2 439.8 320 350.7 320l-189.4 0z"]},Qk=pW,mW="/assets/logo_sin_letras-C8UJbFJR.png",Zk=()=>O.jsx(Kl,{className:"main-logo-link",to:"/",children:O.jsx("img",{className:"main-logo",src:mW,alt:"logo embajada de venezuela en mexico"})}),gW="data:image/svg+xml,%3csvg%20id='Layer_1'%20data-name='Layer%201'%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2050%2050'%3e%3cdefs%3e%3cstyle%3e%20.cls-1%20{%20fill:%20%23dadada;%20}%20%3c/style%3e%3c/defs%3e%3cpath%20class='cls-1'%20d='M12.85,39.27c8.81-8.81,17.61-17.61,26.42-26.42,1.37-1.37-.75-3.49-2.12-2.12-8.81,8.81-17.61,17.61-26.42,26.42-1.37,1.37,.75,3.49,2.12,2.12h0Z'/%3e%3cpath%20class='cls-1'%20d='M39.27,37.15C30.46,28.34,21.66,19.54,12.85,10.73c-1.37-1.37-3.49,.75-2.12,2.12,8.81,8.81,17.61,17.61,26.42,26.42,1.37,1.37,3.49-.75,2.12-2.12h0Z'/%3e%3c/svg%3e",vW="data:image/svg+xml,%3csvg%20id='Layer_1'%20data-name='Layer%201'%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2050%2050'%3e%3cpath%20d='M12.85,39.27c8.81-8.81,17.61-17.61,26.42-26.42,1.37-1.37-.75-3.49-2.12-2.12-8.81,8.81-17.61,17.61-26.42,26.42-1.37,1.37,.75,3.49,2.12,2.12h0Z'/%3e%3cpath%20d='M39.27,37.15C30.46,28.34,21.66,19.54,12.85,10.73c-1.37-1.37-3.49,.75-2.12,2.12,8.81,8.81,17.61,17.61,26.42,26.42,1.37,1.37,3.49-.75,2.12-2.12h0Z'/%3e%3c/svg%3e",i2=({setShowMenu:t=()=>{},wichMenu:e,email:n,isValMenu:r,navigate:a,logout:i,isMobile:s})=>{const{pathname:o}=da(),l=e.filter(({link:u,deparment:c})=>u!==o&&c!==o);return O.jsxs("div",{className:`menu-container ${r?"menu-alt-color":""}`,children:[O.jsx("img",{src:r?vW:gW,className:"close-menu-icon",onClick:()=>t(!1)}),O.jsx("div",{className:"main-logo-menu-mobile",children:O.jsx(Zk,{})}),l.map(({title:u,link:c,react:h,deparment:f})=>h?O.jsx(Kl,{className:`link-menu ${r?"link-menu-alt-color":""}`,to:c||f,onClick:()=>t(!1),children:u},u):O.jsx("a",{href:c,target:"_blank",className:"link-menu",children:u},u)),r&&O.jsx("button",{className:"logout-button",onClick:()=>i(a),children:dk}),n&&!r&&!s&&O.jsx(Kl,{className:"link-menu",to:"/login",children:O.jsx(Bo,{icon:Qk})})]})},_W="data:image/svg+xml,%3csvg%20id='Layer_1'%20data-name='Layer%201'%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2050%2050'%3e%3cdefs%3e%3cstyle%3e%20.cls-1%20{%20fill:%20%23dadada;%20}%20%3c/style%3e%3c/defs%3e%3cpath%20class='cls-1'%20d='M6.32,18.59c12.45,.03,24.91,.06,37.36,.09,1.93,0,1.93-3,0-3-12.45-.03-24.91-.06-37.36-.09-1.93,0-1.93,3,0,3h0Z'/%3e%3cpath%20class='cls-1'%20d='M6.32,34.31c12.45,.03,24.91,.06,37.36,.09,1.93,0,1.93-3,0-3-12.45-.03-24.91-.06-37.36-.09-1.93,0-1.93,3,0,3h0Z'/%3e%3c/svg%3e",yW="data:image/svg+xml,%3csvg%20id='Layer_1'%20data-name='Layer%201'%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2050%2050'%3e%3cdefs%3e%3cstyle%3e%20.cls-1%20{%20fill:%20%23231f20;%20}%20%3c/style%3e%3c/defs%3e%3cpath%20class='cls-1'%20d='M6.32,18.59c12.45,.03,24.91,.06,37.36,.09,1.93,0,1.93-3,0-3-12.45-.03-24.91-.06-37.36-.09-1.93,0-1.93,3,0,3h0Z'/%3e%3cpath%20class='cls-1'%20d='M6.32,34.31c12.45,.03,24.91,.06,37.36,.09,1.93,0,1.93-3,0-3-12.45-.03-24.91-.06-37.36-.09-1.93,0-1.93,3,0,3h0Z'/%3e%3c/svg%3e",wm=[{title:"Código",deparment:"/codigo",emails:["embvemex.temporal@gmail.com","admon.embvenmex@gmail.com"],react:!0},{title:"Notas",deparment:"/numero-nota",emails:["mmorun23@gmail.com","jhsarug68@gmail.com","yajacielo@gmail.com","aldoperfetto@gmail.com","yaimaragimenez@gmail.com","santellmon@hotmail.com","aliciaventura@yahoo.com","judith_jn@yahoo.com.mx","embvemex.temporal@gmail.com"],react:!0},{title:"Carta de Identidad",deparment:"/validation/carta-identidad",emails:["algimirojas@gmail.com","aldoperfetto@gmail.com","embvemex.temporal@gmail.com"],react:!0},{title:"Salvoconducto VZLA",deparment:"/validation/salvoconducto-vzla",emails:["embvemex.temporal@gmail.com","jhsarug68@gmail.com"],react:!0},{title:"Fe de vida",deparment:"/validation/fe-vida",emails:["jhsarug68@gmail.com","embvemex.temporal@gmail.com"],react:!0},{title:"Visa",deparment:"/validation/visa-vzla",emails:["pgrgoncalves@gmail.com","embvemex.temporal@gmail.com"],react:!0},{title:"Cita SAIME",deparment:"/validation/cita-saime",emails:["mmorun23@gmail.com","embvemex.temporal@gmail.com"],react:!0}];function eN(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var a=t.length;for(e=0;etypeof t=="number"&&!isNaN(t),lo=t=>typeof t=="string",Sr=t=>typeof t=="function",Xf=t=>lo(t)||Sr(t)?t:null,g_=t=>X.isValidElement(t)||lo(t)||Sr(t)||Md(t);function EW(t,e,n){n===void 0&&(n=300);const{scrollHeight:r,style:a}=t;requestAnimationFrame(()=>{a.minHeight="initial",a.height=r+"px",a.transition=`all ${n}ms`,requestAnimationFrame(()=>{a.height="0",a.padding="0",a.margin="0",setTimeout(e,n)})})}function Cm(t){let{enter:e,exit:n,appendPosition:r=!1,collapse:a=!0,collapseDuration:i=300}=t;return function(s){let{children:o,position:l,preventExitTransition:u,done:c,nodeRef:h,isIn:f,playToast:p}=s;const g=r?`${e}--${l}`:e,m=r?`${n}--${l}`:n,_=X.useRef(0);return X.useLayoutEffect(()=>{const x=h.current,E=g.split(" "),y=I=>{I.target===h.current&&(p(),x.removeEventListener("animationend",y),x.removeEventListener("animationcancel",y),_.current===0&&I.type!=="animationcancel"&&x.classList.remove(...E))};x.classList.add(...E),x.addEventListener("animationend",y),x.addEventListener("animationcancel",y)},[]),X.useEffect(()=>{const x=h.current,E=()=>{x.removeEventListener("animationend",E),a?EW(x,c,i):c()};f||(u?E():(_.current=1,x.className+=` ${m}`,x.addEventListener("animationend",E)))},[f]),je.createElement(je.Fragment,null,o)}}function s2(t,e){return t!=null?{content:t.content,containerId:t.props.containerId,id:t.props.toastId,theme:t.props.theme,type:t.props.type,data:t.props.data||{},isLoading:t.props.isLoading,icon:t.props.icon,status:e}:{}}const $n=new Map;let Ld=[];const v_=new Set,bW=t=>v_.forEach(e=>e(t)),tN=()=>$n.size>0;function nN(t,e){var n;if(e)return!((n=$n.get(e))==null||!n.isToastActive(t));let r=!1;return $n.forEach(a=>{a.isToastActive(t)&&(r=!0)}),r}function rN(t,e){g_(t)&&(tN()||Ld.push({content:t,options:e}),$n.forEach(n=>{n.buildToast(t,e)}))}function o2(t,e){$n.forEach(n=>{e!=null&&e!=null&&e.containerId?(e==null?void 0:e.containerId)===n.id&&n.toggle(t,e==null?void 0:e.id):n.toggle(t,e==null?void 0:e.id)})}function xW(t){const{subscribe:e,getSnapshot:n,setProps:r}=X.useRef(function(i){const s=i.containerId||1;return{subscribe(o){const l=function(c,h,f){let p=1,g=0,m=[],_=[],x=[],E=h;const y=new Map,I=new Set,j=()=>{x=Array.from(y.values()),I.forEach(S=>S())},G=S=>{_=S==null?[]:_.filter(w=>w!==S),j()},T=S=>{const{toastId:w,onOpen:A,updateId:R,children:L}=S.props,N=R==null;S.staleId&&y.delete(S.staleId),y.set(w,S),_=[..._,S.props.toastId].filter(Re=>Re!==S.staleId),j(),f(s2(S,N?"added":"updated")),N&&Sr(A)&&A(X.isValidElement(L)&&L.props)};return{id:c,props:E,observe:S=>(I.add(S),()=>I.delete(S)),toggle:(S,w)=>{y.forEach(A=>{w!=null&&w!==A.props.toastId||Sr(A.toggle)&&A.toggle(S)})},removeToast:G,toasts:y,clearQueue:()=>{g-=m.length,m=[]},buildToast:(S,w)=>{if((V=>{let{containerId:H,toastId:q,updateId:z}=V;const re=H?H!==c:c!==1,_e=y.has(q)&&z==null;return re||_e})(w))return;const{toastId:A,updateId:R,data:L,staleId:N,delay:Re}=w,Pe=()=>{G(A)},ft=R==null;ft&&g++;const Ue={...E,style:E.toastStyle,key:p++,...Object.fromEntries(Object.entries(w).filter(V=>{let[H,q]=V;return q!=null})),toastId:A,updateId:R,data:L,closeToast:Pe,isIn:!1,className:Xf(w.className||E.toastClassName),bodyClassName:Xf(w.bodyClassName||E.bodyClassName),progressClassName:Xf(w.progressClassName||E.progressClassName),autoClose:!w.isLoading&&(le=w.autoClose,ye=E.autoClose,le===!1||Md(le)&&le>0?le:ye),deleteToast(){const V=y.get(A),{onClose:H,children:q}=V.props;Sr(H)&&H(X.isValidElement(q)&&q.props),f(s2(V,"removed")),y.delete(A),g--,g<0&&(g=0),m.length>0?T(m.shift()):j()}};var le,ye;Ue.closeButton=E.closeButton,w.closeButton===!1||g_(w.closeButton)?Ue.closeButton=w.closeButton:w.closeButton===!0&&(Ue.closeButton=!g_(E.closeButton)||E.closeButton);let we=S;X.isValidElement(S)&&!lo(S.type)?we=X.cloneElement(S,{closeToast:Pe,toastProps:Ue,data:L}):Sr(S)&&(we=S({closeToast:Pe,toastProps:Ue,data:L}));const De={content:we,props:Ue,staleId:N};E.limit&&E.limit>0&&g>E.limit&&ft?m.push(De):Md(Re)?setTimeout(()=>{T(De)},Re):T(De)},setProps(S){E=S},setToggle:(S,w)=>{y.get(S).toggle=w},isToastActive:S=>_.some(w=>w===S),getSnapshot:()=>E.newestOnTop?x.reverse():x}}(s,i,bW);$n.set(s,l);const u=l.observe(o);return Ld.forEach(c=>rN(c.content,c.options)),Ld=[],()=>{u(),$n.delete(s)}},setProps(o){var l;(l=$n.get(s))==null||l.setProps(o)},getSnapshot(){var o;return(o=$n.get(s))==null?void 0:o.getSnapshot()}}}(t)).current;r(t);const a=X.useSyncExternalStore(e,n,n);return{getToastToRender:function(i){if(!a)return[];const s=new Map;return a.forEach(o=>{const{position:l}=o.props;s.has(l)||s.set(l,[]),s.get(l).push(o)}),Array.from(s,o=>i(o[0],o[1]))},isToastActive:nN,count:a==null?void 0:a.length}}function SW(t){const[e,n]=X.useState(!1),[r,a]=X.useState(!1),i=X.useRef(null),s=X.useRef({start:0,delta:0,removalDistance:0,canCloseOnClick:!0,canDrag:!1,didMove:!1}).current,{autoClose:o,pauseOnHover:l,closeToast:u,onClick:c,closeOnClick:h}=t;var f,p;function g(){n(!0)}function m(){n(!1)}function _(y){const I=i.current;s.canDrag&&I&&(s.didMove=!0,e&&m(),s.delta=t.draggableDirection==="x"?y.clientX-s.start:y.clientY-s.start,s.start!==y.clientX&&(s.canCloseOnClick=!1),I.style.transform=`translate3d(${t.draggableDirection==="x"?`${s.delta}px, var(--y)`:`0, calc(${s.delta}px + var(--y))`},0)`,I.style.opacity=""+(1-Math.abs(s.delta/s.removalDistance)))}function x(){document.removeEventListener("pointermove",_),document.removeEventListener("pointerup",x);const y=i.current;if(s.canDrag&&s.didMove&&y){if(s.canDrag=!1,Math.abs(s.delta)>s.removalDistance)return a(!0),t.closeToast(),void t.collapseAll();y.style.transition="transform 0.2s, opacity 0.2s",y.style.removeProperty("transform"),y.style.removeProperty("opacity")}}(p=$n.get((f={id:t.toastId,containerId:t.containerId,fn:n}).containerId||1))==null||p.setToggle(f.id,f.fn),X.useEffect(()=>{if(t.pauseOnFocusLoss)return document.hasFocus()||m(),window.addEventListener("focus",g),window.addEventListener("blur",m),()=>{window.removeEventListener("focus",g),window.removeEventListener("blur",m)}},[t.pauseOnFocusLoss]);const E={onPointerDown:function(y){if(t.draggable===!0||t.draggable===y.pointerType){s.didMove=!1,document.addEventListener("pointermove",_),document.addEventListener("pointerup",x);const I=i.current;s.canCloseOnClick=!0,s.canDrag=!0,I.style.transition="none",t.draggableDirection==="x"?(s.start=y.clientX,s.removalDistance=I.offsetWidth*(t.draggablePercent/100)):(s.start=y.clientY,s.removalDistance=I.offsetHeight*(t.draggablePercent===80?1.5*t.draggablePercent:t.draggablePercent)/100)}},onPointerUp:function(y){const{top:I,bottom:j,left:G,right:T}=i.current.getBoundingClientRect();y.nativeEvent.type!=="touchend"&&t.pauseOnHover&&y.clientX>=G&&y.clientX<=T&&y.clientY>=I&&y.clientY<=j?m():g()}};return o&&l&&(E.onMouseEnter=m,t.stacked||(E.onMouseLeave=g)),h&&(E.onClick=y=>{c&&c(y),s.canCloseOnClick&&u()}),{playToast:g,pauseToast:m,isRunning:e,preventExitTransition:r,toastRef:i,eventHandlers:E}}function TW(t){let{delay:e,isRunning:n,closeToast:r,type:a="default",hide:i,className:s,style:o,controlledProgress:l,progress:u,rtl:c,isIn:h,theme:f}=t;const p=i||l&&u===0,g={...o,animationDuration:`${e}ms`,animationPlayState:n?"running":"paused"};l&&(g.transform=`scaleX(${u})`);const m=Wi("Toastify__progress-bar",l?"Toastify__progress-bar--controlled":"Toastify__progress-bar--animated",`Toastify__progress-bar-theme--${f}`,`Toastify__progress-bar--${a}`,{"Toastify__progress-bar--rtl":c}),_=Sr(s)?s({rtl:c,type:a,defaultClassName:m}):Wi(m,s),x={[l&&u>=1?"onTransitionEnd":"onAnimationEnd"]:l&&u<1?null:()=>{h&&r()}};return je.createElement("div",{className:"Toastify__progress-bar--wrp","data-hidden":p},je.createElement("div",{className:`Toastify__progress-bar--bg Toastify__progress-bar-theme--${f} Toastify__progress-bar--${a}`}),je.createElement("div",{role:"progressbar","aria-hidden":p?"true":"false","aria-label":"notification timer",className:_,style:g,...x}))}let wW=1;const aN=()=>""+wW++;function CW(t){return t&&(lo(t.toastId)||Md(t.toastId))?t.toastId:aN()}function zc(t,e){return rN(t,e),e.toastId}function a0(t,e){return{...e,type:e&&e.type||t,toastId:CW(e)}}function mf(t){return(e,n)=>zc(e,a0(t,n))}function Ie(t,e){return zc(t,a0("default",e))}Ie.loading=(t,e)=>zc(t,a0("default",{isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1,...e})),Ie.promise=function(t,e,n){let r,{pending:a,error:i,success:s}=e;a&&(r=lo(a)?Ie.loading(a,n):Ie.loading(a.render,{...n,...a}));const o={isLoading:null,autoClose:null,closeOnClick:null,closeButton:null,draggable:null},l=(c,h,f)=>{if(h==null)return void Ie.dismiss(r);const p={type:c,...o,...n,data:f},g=lo(h)?{render:h}:h;return r?Ie.update(r,{...p,...g}):Ie(g.render,{...p,...g}),f},u=Sr(t)?t():t;return u.then(c=>l("success",s,c)).catch(c=>l("error",i,c)),u},Ie.success=mf("success"),Ie.info=mf("info"),Ie.error=mf("error"),Ie.warning=mf("warning"),Ie.warn=Ie.warning,Ie.dark=(t,e)=>zc(t,a0("default",{theme:"dark",...e})),Ie.dismiss=function(t){(function(e){var n;if(tN()){if(e==null||lo(n=e)||Md(n))$n.forEach(r=>{r.removeToast(e)});else if(e&&("containerId"in e||"id"in e)){const r=$n.get(e.containerId);r?r.removeToast(e.id):$n.forEach(a=>{a.removeToast(e.id)})}}else Ld=Ld.filter(r=>e!=null&&r.options.toastId!==e)})(t)},Ie.clearWaitingQueue=function(t){t===void 0&&(t={}),$n.forEach(e=>{!e.props.limit||t.containerId&&e.id!==t.containerId||e.clearQueue()})},Ie.isActive=nN,Ie.update=function(t,e){e===void 0&&(e={});const n=((r,a)=>{var i;let{containerId:s}=a;return(i=$n.get(s||1))==null?void 0:i.toasts.get(r)})(t,e);if(n){const{props:r,content:a}=n,i={delay:100,...r,...e,toastId:e.toastId||t,updateId:aN()};i.toastId!==t&&(i.staleId=t);const s=i.render||a;delete i.render,zc(s,i)}},Ie.done=t=>{Ie.update(t,{progress:1})},Ie.onChange=function(t){return v_.add(t),()=>{v_.delete(t)}},Ie.play=t=>o2(!0,t),Ie.pause=t=>o2(!1,t);const AW=typeof window<"u"?X.useLayoutEffect:X.useEffect,gf=t=>{let{theme:e,type:n,isLoading:r,...a}=t;return je.createElement("svg",{viewBox:"0 0 24 24",width:"100%",height:"100%",fill:e==="colored"?"currentColor":`var(--toastify-icon-color-${n})`,...a})},nv={info:function(t){return je.createElement(gf,{...t},je.createElement("path",{d:"M12 0a12 12 0 1012 12A12.013 12.013 0 0012 0zm.25 5a1.5 1.5 0 11-1.5 1.5 1.5 1.5 0 011.5-1.5zm2.25 13.5h-4a1 1 0 010-2h.75a.25.25 0 00.25-.25v-4.5a.25.25 0 00-.25-.25h-.75a1 1 0 010-2h1a2 2 0 012 2v4.75a.25.25 0 00.25.25h.75a1 1 0 110 2z"}))},warning:function(t){return je.createElement(gf,{...t},je.createElement("path",{d:"M23.32 17.191L15.438 2.184C14.728.833 13.416 0 11.996 0c-1.42 0-2.733.833-3.443 2.184L.533 17.448a4.744 4.744 0 000 4.368C1.243 23.167 2.555 24 3.975 24h16.05C22.22 24 24 22.044 24 19.632c0-.904-.251-1.746-.68-2.44zm-9.622 1.46c0 1.033-.724 1.823-1.698 1.823s-1.698-.79-1.698-1.822v-.043c0-1.028.724-1.822 1.698-1.822s1.698.79 1.698 1.822v.043zm.039-12.285l-.84 8.06c-.057.581-.408.943-.897.943-.49 0-.84-.367-.896-.942l-.84-8.065c-.057-.624.25-1.095.779-1.095h1.91c.528.005.84.476.784 1.1z"}))},success:function(t){return je.createElement(gf,{...t},je.createElement("path",{d:"M12 0a12 12 0 1012 12A12.014 12.014 0 0012 0zm6.927 8.2l-6.845 9.289a1.011 1.011 0 01-1.43.188l-4.888-3.908a1 1 0 111.25-1.562l4.076 3.261 6.227-8.451a1 1 0 111.61 1.183z"}))},error:function(t){return je.createElement(gf,{...t},je.createElement("path",{d:"M11.983 0a12.206 12.206 0 00-8.51 3.653A11.8 11.8 0 000 12.207 11.779 11.779 0 0011.8 24h.214A12.111 12.111 0 0024 11.791 11.766 11.766 0 0011.983 0zM10.5 16.542a1.476 1.476 0 011.449-1.53h.027a1.527 1.527 0 011.523 1.47 1.475 1.475 0 01-1.449 1.53h-.027a1.529 1.529 0 01-1.523-1.47zM11 12.5v-6a1 1 0 012 0v6a1 1 0 11-2 0z"}))},spinner:function(){return je.createElement("div",{className:"Toastify__spinner"})}},IW=t=>{const{isRunning:e,preventExitTransition:n,toastRef:r,eventHandlers:a,playToast:i}=SW(t),{closeButton:s,children:o,autoClose:l,onClick:u,type:c,hideProgressBar:h,closeToast:f,transition:p,position:g,className:m,style:_,bodyClassName:x,bodyStyle:E,progressClassName:y,progressStyle:I,updateId:j,role:G,progress:T,rtl:S,toastId:w,deleteToast:A,isIn:R,isLoading:L,closeOnClick:N,theme:Re}=t,Pe=Wi("Toastify__toast",`Toastify__toast-theme--${Re}`,`Toastify__toast--${c}`,{"Toastify__toast--rtl":S},{"Toastify__toast--close-on-click":N}),ft=Sr(m)?m({rtl:S,position:g,type:c,defaultClassName:Pe}):Wi(Pe,m),Ue=function(De){let{theme:V,type:H,isLoading:q,icon:z}=De,re=null;const _e={theme:V,type:H};return z===!1||(Sr(z)?re=z({..._e,isLoading:q}):X.isValidElement(z)?re=X.cloneElement(z,_e):q?re=nv.spinner():(Ae=>Ae in nv)(H)&&(re=nv[H](_e))),re}(t),le=!!T||!l,ye={closeToast:f,type:c,theme:Re};let we=null;return s===!1||(we=Sr(s)?s(ye):X.isValidElement(s)?X.cloneElement(s,ye):function(De){let{closeToast:V,theme:H,ariaLabel:q="close"}=De;return je.createElement("button",{className:`Toastify__close-button Toastify__close-button--${H}`,type:"button",onClick:z=>{z.stopPropagation(),V(z)},"aria-label":q},je.createElement("svg",{"aria-hidden":"true",viewBox:"0 0 14 16"},je.createElement("path",{fillRule:"evenodd",d:"M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z"})))}(ye)),je.createElement(p,{isIn:R,done:A,position:g,preventExitTransition:n,nodeRef:r,playToast:i},je.createElement("div",{id:w,onClick:u,"data-in":R,className:ft,...a,style:_,ref:r},je.createElement("div",{...R&&{role:G},className:Sr(x)?x({type:c}):Wi("Toastify__toast-body",x),style:E},Ue!=null&&je.createElement("div",{className:Wi("Toastify__toast-icon",{"Toastify--animate-icon Toastify__zoom-enter":!L})},Ue),je.createElement("div",null,o)),we,je.createElement(TW,{...j&&!le?{key:`pb-${j}`}:{},rtl:S,theme:Re,delay:l,isRunning:e,isIn:R,closeToast:f,hide:h,type:c,style:I,className:y,controlledProgress:le,progress:T||0})))},Am=function(t,e){return e===void 0&&(e=!1),{enter:`Toastify--animate Toastify__${t}-enter`,exit:`Toastify--animate Toastify__${t}-exit`,appendPosition:e}},PW=Cm(Am("bounce",!0));Cm(Am("slide",!0));Cm(Am("zoom"));Cm(Am("flip"));const RW={position:"top-right",transition:PW,autoClose:5e3,closeButton:!0,pauseOnHover:!0,pauseOnFocusLoss:!0,draggable:"touch",draggablePercent:80,draggableDirection:"x",role:"alert",theme:"light"};function kW(t){let e={...RW,...t};const n=t.stacked,[r,a]=X.useState(!0),i=X.useRef(null),{getToastToRender:s,isToastActive:o,count:l}=xW(e),{className:u,style:c,rtl:h,containerId:f}=e;function p(m){const _=Wi("Toastify__toast-container",`Toastify__toast-container--${m}`,{"Toastify__toast-container--rtl":h});return Sr(u)?u({position:m,rtl:h,defaultClassName:_}):Wi(_,Xf(u))}function g(){n&&(a(!0),Ie.play())}return AW(()=>{if(n){var m;const _=i.current.querySelectorAll('[data-in="true"]'),x=12,E=(m=e.position)==null?void 0:m.includes("top");let y=0,I=0;Array.from(_).reverse().forEach((j,G)=>{const T=j;T.classList.add("Toastify__toast--stacked"),G>0&&(T.dataset.collapsed=`${r}`),T.dataset.pos||(T.dataset.pos=E?"top":"bot");const S=y*(r?.2:1)+(r?0:x*G);T.style.setProperty("--y",`${E?S:-1*S}px`),T.style.setProperty("--g",`${x}`),T.style.setProperty("--s",""+(1-(r?I:0))),y+=T.offsetHeight,I+=.025})}},[r,l,n]),je.createElement("div",{ref:i,className:"Toastify",id:f,onMouseEnter:()=>{n&&(a(!1),Ie.pause())},onMouseLeave:g},s((m,_)=>{const x=_.length?{...c}:{...c,pointerEvents:"none"};return je.createElement("div",{className:p(m),style:x,key:`container-${m}`},_.map(E=>{let{content:y,props:I}=E;return je.createElement(IW,{...I,stacked:n,collapseAll:g,isIn:o(I.toastId,I.containerId),style:I.style,key:`toast-${I.key}`},y)}))}))}function iN(t,e){return function(){return t.apply(e,arguments)}}const{toString:NW}=Object.prototype,{getPrototypeOf:ub}=Object,Im=(t=>e=>{const n=NW.call(e);return t[n]||(t[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),ha=t=>(t=t.toLowerCase(),e=>Im(e)===t),Pm=t=>e=>typeof e===t,{isArray:Cu}=Array,Dd=Pm("undefined");function OW(t){return t!==null&&!Dd(t)&&t.constructor!==null&&!Dd(t.constructor)&&Ar(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const sN=ha("ArrayBuffer");function MW(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&sN(t.buffer),e}const LW=Pm("string"),Ar=Pm("function"),oN=Pm("number"),Rm=t=>t!==null&&typeof t=="object",DW=t=>t===!0||t===!1,Qf=t=>{if(Im(t)!=="object")return!1;const e=ub(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)},FW=ha("Date"),BW=ha("File"),UW=ha("Blob"),VW=ha("FileList"),jW=t=>Rm(t)&&Ar(t.pipe),zW=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||Ar(t.append)&&((e=Im(t))==="formdata"||e==="object"&&Ar(t.toString)&&t.toString()==="[object FormData]"))},qW=ha("URLSearchParams"),[GW,HW,WW,$W]=["ReadableStream","Request","Response","Headers"].map(ha),KW=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function _h(t,e,{allOwnKeys:n=!1}={}){if(t===null||typeof t>"u")return;let r,a;if(typeof t!="object"&&(t=[t]),Cu(t))for(r=0,a=t.length;r0;)if(a=n[r],e===a.toLowerCase())return a;return null}const Zs=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,uN=t=>!Dd(t)&&t!==Zs;function __(){const{caseless:t}=uN(this)&&this||{},e={},n=(r,a)=>{const i=t&&lN(e,a)||a;Qf(e[i])&&Qf(r)?e[i]=__(e[i],r):Qf(r)?e[i]=__({},r):Cu(r)?e[i]=r.slice():e[i]=r};for(let r=0,a=arguments.length;r(_h(e,(a,i)=>{n&&Ar(a)?t[i]=iN(a,n):t[i]=a},{allOwnKeys:r}),t),YW=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),XW=(t,e,n,r)=>{t.prototype=Object.create(e.prototype,r),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),n&&Object.assign(t.prototype,n)},QW=(t,e,n,r)=>{let a,i,s;const o={};if(e=e||{},t==null)return e;do{for(a=Object.getOwnPropertyNames(t),i=a.length;i-- >0;)s=a[i],(!r||r(s,t,e))&&!o[s]&&(e[s]=t[s],o[s]=!0);t=n!==!1&&ub(t)}while(t&&(!n||n(t,e))&&t!==Object.prototype);return e},ZW=(t,e,n)=>{t=String(t),(n===void 0||n>t.length)&&(n=t.length),n-=e.length;const r=t.indexOf(e,n);return r!==-1&&r===n},e$=t=>{if(!t)return null;if(Cu(t))return t;let e=t.length;if(!oN(e))return null;const n=new Array(e);for(;e-- >0;)n[e]=t[e];return n},t$=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&ub(Uint8Array)),n$=(t,e)=>{const r=(t&&t[Symbol.iterator]).call(t);let a;for(;(a=r.next())&&!a.done;){const i=a.value;e.call(t,i[0],i[1])}},r$=(t,e)=>{let n;const r=[];for(;(n=t.exec(e))!==null;)r.push(n);return r},a$=ha("HTMLFormElement"),i$=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,a){return r.toUpperCase()+a}),l2=(({hasOwnProperty:t})=>(e,n)=>t.call(e,n))(Object.prototype),s$=ha("RegExp"),cN=(t,e)=>{const n=Object.getOwnPropertyDescriptors(t),r={};_h(n,(a,i)=>{let s;(s=e(a,i,t))!==!1&&(r[i]=s||a)}),Object.defineProperties(t,r)},o$=t=>{cN(t,(e,n)=>{if(Ar(t)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=t[n];if(Ar(r)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},l$=(t,e)=>{const n={},r=a=>{a.forEach(i=>{n[i]=!0})};return Cu(t)?r(t):r(String(t).split(e)),n},u$=()=>{},c$=(t,e)=>t!=null&&Number.isFinite(t=+t)?t:e,rv="abcdefghijklmnopqrstuvwxyz",u2="0123456789",dN={DIGIT:u2,ALPHA:rv,ALPHA_DIGIT:rv+rv.toUpperCase()+u2},d$=(t=16,e=dN.ALPHA_DIGIT)=>{let n="";const{length:r}=e;for(;t--;)n+=e[Math.random()*r|0];return n};function h$(t){return!!(t&&Ar(t.append)&&t[Symbol.toStringTag]==="FormData"&&t[Symbol.iterator])}const f$=t=>{const e=new Array(10),n=(r,a)=>{if(Rm(r)){if(e.indexOf(r)>=0)return;if(!("toJSON"in r)){e[a]=r;const i=Cu(r)?[]:{};return _h(r,(s,o)=>{const l=n(s,a+1);!Dd(l)&&(i[o]=l)}),e[a]=void 0,i}}return r};return n(t,0)},p$=ha("AsyncFunction"),m$=t=>t&&(Rm(t)||Ar(t))&&Ar(t.then)&&Ar(t.catch),hN=((t,e)=>t?setImmediate:e?((n,r)=>(Zs.addEventListener("message",({source:a,data:i})=>{a===Zs&&i===n&&r.length&&r.shift()()},!1),a=>{r.push(a),Zs.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",Ar(Zs.postMessage)),g$=typeof queueMicrotask<"u"?queueMicrotask.bind(Zs):typeof process<"u"&&process.nextTick||hN,ee={isArray:Cu,isArrayBuffer:sN,isBuffer:OW,isFormData:zW,isArrayBufferView:MW,isString:LW,isNumber:oN,isBoolean:DW,isObject:Rm,isPlainObject:Qf,isReadableStream:GW,isRequest:HW,isResponse:WW,isHeaders:$W,isUndefined:Dd,isDate:FW,isFile:BW,isBlob:UW,isRegExp:s$,isFunction:Ar,isStream:jW,isURLSearchParams:qW,isTypedArray:t$,isFileList:VW,forEach:_h,merge:__,extend:JW,trim:KW,stripBOM:YW,inherits:XW,toFlatObject:QW,kindOf:Im,kindOfTest:ha,endsWith:ZW,toArray:e$,forEachEntry:n$,matchAll:r$,isHTMLForm:a$,hasOwnProperty:l2,hasOwnProp:l2,reduceDescriptors:cN,freezeMethods:o$,toObjectSet:l$,toCamelCase:i$,noop:u$,toFiniteNumber:c$,findKey:lN,global:Zs,isContextDefined:uN,ALPHABET:dN,generateString:d$,isSpecCompliantForm:h$,toJSONObject:f$,isAsyncFn:p$,isThenable:m$,setImmediate:hN,asap:g$};function Be(t,e,n,r,a){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=t,this.name="AxiosError",e&&(this.code=e),n&&(this.config=n),r&&(this.request=r),a&&(this.response=a,this.status=a.status?a.status:null)}ee.inherits(Be,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:ee.toJSONObject(this.config),code:this.code,status:this.status}}});const fN=Be.prototype,pN={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(t=>{pN[t]={value:t}});Object.defineProperties(Be,pN);Object.defineProperty(fN,"isAxiosError",{value:!0});Be.from=(t,e,n,r,a,i)=>{const s=Object.create(fN);return ee.toFlatObject(t,s,function(l){return l!==Error.prototype},o=>o!=="isAxiosError"),Be.call(s,t.message,e,n,r,a),s.cause=t,s.name=t.name,i&&Object.assign(s,i),s};const v$=null;function y_(t){return ee.isPlainObject(t)||ee.isArray(t)}function mN(t){return ee.endsWith(t,"[]")?t.slice(0,-2):t}function c2(t,e,n){return t?t.concat(e).map(function(a,i){return a=mN(a),!n&&i?"["+a+"]":a}).join(n?".":""):e}function _$(t){return ee.isArray(t)&&!t.some(y_)}const y$=ee.toFlatObject(ee,{},null,function(e){return/^is[A-Z]/.test(e)});function km(t,e,n){if(!ee.isObject(t))throw new TypeError("target must be an object");e=e||new FormData,n=ee.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(m,_){return!ee.isUndefined(_[m])});const r=n.metaTokens,a=n.visitor||c,i=n.dots,s=n.indexes,l=(n.Blob||typeof Blob<"u"&&Blob)&&ee.isSpecCompliantForm(e);if(!ee.isFunction(a))throw new TypeError("visitor must be a function");function u(g){if(g===null)return"";if(ee.isDate(g))return g.toISOString();if(!l&&ee.isBlob(g))throw new Be("Blob is not supported. Use a Buffer instead.");return ee.isArrayBuffer(g)||ee.isTypedArray(g)?l&&typeof Blob=="function"?new Blob([g]):Buffer.from(g):g}function c(g,m,_){let x=g;if(g&&!_&&typeof g=="object"){if(ee.endsWith(m,"{}"))m=r?m:m.slice(0,-2),g=JSON.stringify(g);else if(ee.isArray(g)&&_$(g)||(ee.isFileList(g)||ee.endsWith(m,"[]"))&&(x=ee.toArray(g)))return m=mN(m),x.forEach(function(y,I){!(ee.isUndefined(y)||y===null)&&e.append(s===!0?c2([m],I,i):s===null?m:m+"[]",u(y))}),!1}return y_(g)?!0:(e.append(c2(_,m,i),u(g)),!1)}const h=[],f=Object.assign(y$,{defaultVisitor:c,convertValue:u,isVisitable:y_});function p(g,m){if(!ee.isUndefined(g)){if(h.indexOf(g)!==-1)throw Error("Circular reference detected in "+m.join("."));h.push(g),ee.forEach(g,function(x,E){(!(ee.isUndefined(x)||x===null)&&a.call(e,x,ee.isString(E)?E.trim():E,m,f))===!0&&p(x,m?m.concat(E):[E])}),h.pop()}}if(!ee.isObject(t))throw new TypeError("data must be an object");return p(t),e}function d2(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(r){return e[r]})}function cb(t,e){this._pairs=[],t&&km(t,this,e)}const gN=cb.prototype;gN.append=function(e,n){this._pairs.push([e,n])};gN.toString=function(e){const n=e?function(r){return e.call(this,r,d2)}:d2;return this._pairs.map(function(a){return n(a[0])+"="+n(a[1])},"").join("&")};function E$(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function vN(t,e,n){if(!e)return t;const r=n&&n.encode||E$,a=n&&n.serialize;let i;if(a?i=a(e,n):i=ee.isURLSearchParams(e)?e.toString():new cb(e,n).toString(r),i){const s=t.indexOf("#");s!==-1&&(t=t.slice(0,s)),t+=(t.indexOf("?")===-1?"?":"&")+i}return t}class h2{constructor(){this.handlers=[]}use(e,n,r){return this.handlers.push({fulfilled:e,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){ee.forEach(this.handlers,function(r){r!==null&&e(r)})}}const _N={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},b$=typeof URLSearchParams<"u"?URLSearchParams:cb,x$=typeof FormData<"u"?FormData:null,S$=typeof Blob<"u"?Blob:null,T$={isBrowser:!0,classes:{URLSearchParams:b$,FormData:x$,Blob:S$},protocols:["http","https","file","blob","url","data"]},db=typeof window<"u"&&typeof document<"u",E_=typeof navigator=="object"&&navigator||void 0,w$=db&&(!E_||["ReactNative","NativeScript","NS"].indexOf(E_.product)<0),C$=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",A$=db&&window.location.href||"http://localhost",I$=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:db,hasStandardBrowserEnv:w$,hasStandardBrowserWebWorkerEnv:C$,navigator:E_,origin:A$},Symbol.toStringTag,{value:"Module"})),Ir={...I$,...T$};function P$(t,e){return km(t,new Ir.classes.URLSearchParams,Object.assign({visitor:function(n,r,a,i){return Ir.isNode&&ee.isBuffer(n)?(this.append(r,n.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)}},e))}function R$(t){return ee.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function k$(t){const e={},n=Object.keys(t);let r;const a=n.length;let i;for(r=0;r=n.length;return s=!s&&ee.isArray(a)?a.length:s,l?(ee.hasOwnProp(a,s)?a[s]=[a[s],r]:a[s]=r,!o):((!a[s]||!ee.isObject(a[s]))&&(a[s]=[]),e(n,r,a[s],i)&&ee.isArray(a[s])&&(a[s]=k$(a[s])),!o)}if(ee.isFormData(t)&&ee.isFunction(t.entries)){const n={};return ee.forEachEntry(t,(r,a)=>{e(R$(r),a,n,0)}),n}return null}function N$(t,e,n){if(ee.isString(t))try{return(e||JSON.parse)(t),ee.trim(t)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(t)}const yh={transitional:_N,adapter:["xhr","http","fetch"],transformRequest:[function(e,n){const r=n.getContentType()||"",a=r.indexOf("application/json")>-1,i=ee.isObject(e);if(i&&ee.isHTMLForm(e)&&(e=new FormData(e)),ee.isFormData(e))return a?JSON.stringify(yN(e)):e;if(ee.isArrayBuffer(e)||ee.isBuffer(e)||ee.isStream(e)||ee.isFile(e)||ee.isBlob(e)||ee.isReadableStream(e))return e;if(ee.isArrayBufferView(e))return e.buffer;if(ee.isURLSearchParams(e))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let o;if(i){if(r.indexOf("application/x-www-form-urlencoded")>-1)return P$(e,this.formSerializer).toString();if((o=ee.isFileList(e))||r.indexOf("multipart/form-data")>-1){const l=this.env&&this.env.FormData;return km(o?{"files[]":e}:e,l&&new l,this.formSerializer)}}return i||a?(n.setContentType("application/json",!1),N$(e)):e}],transformResponse:[function(e){const n=this.transitional||yh.transitional,r=n&&n.forcedJSONParsing,a=this.responseType==="json";if(ee.isResponse(e)||ee.isReadableStream(e))return e;if(e&&ee.isString(e)&&(r&&!this.responseType||a)){const s=!(n&&n.silentJSONParsing)&&a;try{return JSON.parse(e)}catch(o){if(s)throw o.name==="SyntaxError"?Be.from(o,Be.ERR_BAD_RESPONSE,this,null,this.response):o}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Ir.classes.FormData,Blob:Ir.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};ee.forEach(["delete","get","head","post","put","patch"],t=>{yh.headers[t]={}});const O$=ee.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),M$=t=>{const e={};let n,r,a;return t&&t.split(` `).forEach(function(s){a=s.indexOf(":"),n=s.substring(0,a).trim().toLowerCase(),r=s.substring(a+1).trim(),!(!n||e[n]&&O$[n])&&(n==="set-cookie"?e[n]?e[n].push(r):e[n]=[r]:e[n]=e[n]?e[n]+", "+r:r)}),e},f2=Symbol("internals");function sc(t){return t&&String(t).trim().toLowerCase()}function Zf(t){return t===!1||t==null?t:ee.isArray(t)?t.map(Zf):String(t)}function L$(t){const e=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(t);)e[r[1]]=r[2];return e}const D$=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function av(t,e,n,r,a){if(ee.isFunction(r))return r.call(this,e,n);if(a&&(e=n),!!ee.isString(e)){if(ee.isString(r))return e.indexOf(r)!==-1;if(ee.isRegExp(r))return r.test(e)}}function F$(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,n,r)=>n.toUpperCase()+r)}function B$(t,e){const n=ee.toCamelCase(" "+e);["get","set","has"].forEach(r=>{Object.defineProperty(t,r+n,{value:function(a,i,s){return this[r].call(this,e,a,i,s)},configurable:!0})})}class lr{constructor(e){e&&this.set(e)}set(e,n,r){const a=this;function i(o,l,u){const c=sc(l);if(!c)throw new Error("header name must be a non-empty string");const h=ee.findKey(a,c);(!h||a[h]===void 0||u===!0||u===void 0&&a[h]!==!1)&&(a[h||l]=Zf(o))}const s=(o,l)=>ee.forEach(o,(u,c)=>i(u,c,l));if(ee.isPlainObject(e)||e instanceof this.constructor)s(e,n);else if(ee.isString(e)&&(e=e.trim())&&!D$(e))s(M$(e),n);else if(ee.isHeaders(e))for(const[o,l]of e.entries())i(l,o,r);else e!=null&&i(n,e,r);return this}get(e,n){if(e=sc(e),e){const r=ee.findKey(this,e);if(r){const a=this[r];if(!n)return a;if(n===!0)return L$(a);if(ee.isFunction(n))return n.call(this,a,r);if(ee.isRegExp(n))return n.exec(a);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,n){if(e=sc(e),e){const r=ee.findKey(this,e);return!!(r&&this[r]!==void 0&&(!n||av(this,this[r],r,n)))}return!1}delete(e,n){const r=this;let a=!1;function i(s){if(s=sc(s),s){const o=ee.findKey(r,s);o&&(!n||av(r,r[o],o,n))&&(delete r[o],a=!0)}}return ee.isArray(e)?e.forEach(i):i(e),a}clear(e){const n=Object.keys(this);let r=n.length,a=!1;for(;r--;){const i=n[r];(!e||av(this,this[i],i,e,!0))&&(delete this[i],a=!0)}return a}normalize(e){const n=this,r={};return ee.forEach(this,(a,i)=>{const s=ee.findKey(r,i);if(s){n[s]=Zf(a),delete n[i];return}const o=e?F$(i):String(i).trim();o!==i&&delete n[i],n[o]=Zf(a),r[o]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const n=Object.create(null);return ee.forEach(this,(r,a)=>{r!=null&&r!==!1&&(n[a]=e&&ee.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,n])=>e+": "+n).join(` `)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...n){const r=new this(e);return n.forEach(a=>r.set(a)),r}static accessor(e){const r=(this[f2]=this[f2]={accessors:{}}).accessors,a=this.prototype;function i(s){const o=sc(s);r[o]||(B$(a,s),r[o]=!0)}return ee.isArray(e)?e.forEach(i):i(e),this}}lr.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);ee.reduceDescriptors(lr.prototype,({value:t},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(r){this[n]=r}}});ee.freezeMethods(lr);function iv(t,e){const n=this||yh,r=e||n,a=lr.from(r.headers);let i=r.data;return ee.forEach(t,function(o){i=o.call(n,i,a.normalize(),e?e.status:void 0)}),a.normalize(),i}function EN(t){return!!(t&&t.__CANCEL__)}function Au(t,e,n){Be.call(this,t??"canceled",Be.ERR_CANCELED,e,n),this.name="CanceledError"}ee.inherits(Au,Be,{__CANCEL__:!0});function bN(t,e,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?t(n):e(new Be("Request failed with status code "+n.status,[Be.ERR_BAD_REQUEST,Be.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function U$(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function V$(t,e){t=t||10;const n=new Array(t),r=new Array(t);let a=0,i=0,s;return e=e!==void 0?e:1e3,function(l){const u=Date.now(),c=r[i];s||(s=u),n[a]=l,r[a]=u;let h=i,f=0;for(;h!==a;)f+=n[h++],h=h%t;if(a=(a+1)%t,a===i&&(i=(i+1)%t),u-s{n=c,a=null,i&&(clearTimeout(i),i=null),t.apply(null,u)};return[(...u)=>{const c=Date.now(),h=c-n;h>=r?s(u,c):(a=u,i||(i=setTimeout(()=>{i=null,s(a)},r-h)))},()=>a&&s(a)]}const i0=(t,e,n=3)=>{let r=0;const a=V$(50,250);return j$(i=>{const s=i.loaded,o=i.lengthComputable?i.total:void 0,l=s-r,u=a(l),c=s<=o;r=s;const h={loaded:s,total:o,progress:o?s/o:void 0,bytes:l,rate:u||void 0,estimated:u&&o&&c?(o-s)/u:void 0,event:i,lengthComputable:o!=null,[e?"download":"upload"]:!0};t(h)},n)},p2=(t,e)=>{const n=t!=null;return[r=>e[0]({lengthComputable:n,total:t,loaded:r}),e[1]]},m2=t=>(...e)=>ee.asap(()=>t(...e)),z$=Ir.hasStandardBrowserEnv?function(){const e=Ir.navigator&&/(msie|trident)/i.test(Ir.navigator.userAgent),n=document.createElement("a");let r;function a(i){let s=i;return e&&(n.setAttribute("href",s),s=n.href),n.setAttribute("href",s),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:n.pathname.charAt(0)==="/"?n.pathname:"/"+n.pathname}}return r=a(window.location.href),function(s){const o=ee.isString(s)?a(s):s;return o.protocol===r.protocol&&o.host===r.host}}():function(){return function(){return!0}}(),q$=Ir.hasStandardBrowserEnv?{write(t,e,n,r,a,i){const s=[t+"="+encodeURIComponent(e)];ee.isNumber(n)&&s.push("expires="+new Date(n).toGMTString()),ee.isString(r)&&s.push("path="+r),ee.isString(a)&&s.push("domain="+a),i===!0&&s.push("secure"),document.cookie=s.join("; ")},read(t){const e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(t){this.write(t,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function G$(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function H$(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function xN(t,e){return t&&!G$(e)?H$(t,e):e}const g2=t=>t instanceof lr?{...t}:t;function Ao(t,e){e=e||{};const n={};function r(u,c,h){return ee.isPlainObject(u)&&ee.isPlainObject(c)?ee.merge.call({caseless:h},u,c):ee.isPlainObject(c)?ee.merge({},c):ee.isArray(c)?c.slice():c}function a(u,c,h){if(ee.isUndefined(c)){if(!ee.isUndefined(u))return r(void 0,u,h)}else return r(u,c,h)}function i(u,c){if(!ee.isUndefined(c))return r(void 0,c)}function s(u,c){if(ee.isUndefined(c)){if(!ee.isUndefined(u))return r(void 0,u)}else return r(void 0,c)}function o(u,c,h){if(h in e)return r(u,c);if(h in t)return r(void 0,u)}const l={url:i,method:i,data:i,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:o,headers:(u,c)=>a(g2(u),g2(c),!0)};return ee.forEach(Object.keys(Object.assign({},t,e)),function(c){const h=l[c]||a,f=h(t[c],e[c],c);ee.isUndefined(f)&&h!==o||(n[c]=f)}),n}const SN=t=>{const e=Ao({},t);let{data:n,withXSRFToken:r,xsrfHeaderName:a,xsrfCookieName:i,headers:s,auth:o}=e;e.headers=s=lr.from(s),e.url=vN(xN(e.baseURL,e.url),t.params,t.paramsSerializer),o&&s.set("Authorization","Basic "+btoa((o.username||"")+":"+(o.password?unescape(encodeURIComponent(o.password)):"")));let l;if(ee.isFormData(n)){if(Ir.hasStandardBrowserEnv||Ir.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if((l=s.getContentType())!==!1){const[u,...c]=l?l.split(";").map(h=>h.trim()).filter(Boolean):[];s.setContentType([u||"multipart/form-data",...c].join("; "))}}if(Ir.hasStandardBrowserEnv&&(r&&ee.isFunction(r)&&(r=r(e)),r||r!==!1&&z$(e.url))){const u=a&&i&&q$.read(i);u&&s.set(a,u)}return e},W$=typeof XMLHttpRequest<"u",$$=W$&&function(t){return new Promise(function(n,r){const a=SN(t);let i=a.data;const s=lr.from(a.headers).normalize();let{responseType:o,onUploadProgress:l,onDownloadProgress:u}=a,c,h,f,p,g;function m(){p&&p(),g&&g(),a.cancelToken&&a.cancelToken.unsubscribe(c),a.signal&&a.signal.removeEventListener("abort",c)}let _=new XMLHttpRequest;_.open(a.method.toUpperCase(),a.url,!0),_.timeout=a.timeout;function x(){if(!_)return;const y=lr.from("getAllResponseHeaders"in _&&_.getAllResponseHeaders()),j={data:!o||o==="text"||o==="json"?_.responseText:_.response,status:_.status,statusText:_.statusText,headers:y,config:t,request:_};bN(function(T){n(T),m()},function(T){r(T),m()},j),_=null}"onloadend"in _?_.onloadend=x:_.onreadystatechange=function(){!_||_.readyState!==4||_.status===0&&!(_.responseURL&&_.responseURL.indexOf("file:")===0)||setTimeout(x)},_.onabort=function(){_&&(r(new Be("Request aborted",Be.ECONNABORTED,t,_)),_=null)},_.onerror=function(){r(new Be("Network Error",Be.ERR_NETWORK,t,_)),_=null},_.ontimeout=function(){let I=a.timeout?"timeout of "+a.timeout+"ms exceeded":"timeout exceeded";const j=a.transitional||_N;a.timeoutErrorMessage&&(I=a.timeoutErrorMessage),r(new Be(I,j.clarifyTimeoutError?Be.ETIMEDOUT:Be.ECONNABORTED,t,_)),_=null},i===void 0&&s.setContentType(null),"setRequestHeader"in _&&ee.forEach(s.toJSON(),function(I,j){_.setRequestHeader(j,I)}),ee.isUndefined(a.withCredentials)||(_.withCredentials=!!a.withCredentials),o&&o!=="json"&&(_.responseType=a.responseType),u&&([f,g]=i0(u,!0),_.addEventListener("progress",f)),l&&_.upload&&([h,p]=i0(l),_.upload.addEventListener("progress",h),_.upload.addEventListener("loadend",p)),(a.cancelToken||a.signal)&&(c=y=>{_&&(r(!y||y.type?new Au(null,t,_):y),_.abort(),_=null)},a.cancelToken&&a.cancelToken.subscribe(c),a.signal&&(a.signal.aborted?c():a.signal.addEventListener("abort",c)));const E=U$(a.url);if(E&&Ir.protocols.indexOf(E)===-1){r(new Be("Unsupported protocol "+E+":",Be.ERR_BAD_REQUEST,t));return}_.send(i||null)})},K$=(t,e)=>{let n=new AbortController,r;const a=function(l){if(!r){r=!0,s();const u=l instanceof Error?l:this.reason;n.abort(u instanceof Be?u:new Au(u instanceof Error?u.message:u))}};let i=e&&setTimeout(()=>{a(new Be(`timeout ${e} of ms exceeded`,Be.ETIMEDOUT))},e);const s=()=>{t&&(i&&clearTimeout(i),i=null,t.forEach(l=>{l&&(l.removeEventListener?l.removeEventListener("abort",a):l.unsubscribe(a))}),t=null)};t.forEach(l=>l&&l.addEventListener&&l.addEventListener("abort",a));const{signal:o}=n;return o.unsubscribe=s,[o,()=>{i&&clearTimeout(i),i=null}]},J$=function*(t,e){let n=t.byteLength;if(!e||n{const i=Y$(t,e,a);let s=0,o,l=u=>{o||(o=!0,r&&r(u))};return new ReadableStream({async pull(u){try{const{done:c,value:h}=await i.next();if(c){l(),u.close();return}let f=h.byteLength;if(n){let p=s+=f;n(p)}u.enqueue(new Uint8Array(h))}catch(c){throw l(c),c}},cancel(u){return l(u),i.return()}},{highWaterMark:2})},Nm=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",TN=Nm&&typeof ReadableStream=="function",b_=Nm&&(typeof TextEncoder=="function"?(t=>e=>t.encode(e))(new TextEncoder):async t=>new Uint8Array(await new Response(t).arrayBuffer())),wN=(t,...e)=>{try{return!!t(...e)}catch{return!1}},X$=TN&&wN(()=>{let t=!1;const e=new Request(Ir.origin,{body:new ReadableStream,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type");return t&&!e}),_2=64*1024,x_=TN&&wN(()=>ee.isReadableStream(new Response("").body)),s0={stream:x_&&(t=>t.body)};Nm&&(t=>{["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!s0[e]&&(s0[e]=ee.isFunction(t[e])?n=>n[e]():(n,r)=>{throw new Be(`Response type '${e}' is not supported`,Be.ERR_NOT_SUPPORT,r)})})})(new Response);const Q$=async t=>{if(t==null)return 0;if(ee.isBlob(t))return t.size;if(ee.isSpecCompliantForm(t))return(await new Request(t).arrayBuffer()).byteLength;if(ee.isArrayBufferView(t)||ee.isArrayBuffer(t))return t.byteLength;if(ee.isURLSearchParams(t)&&(t=t+""),ee.isString(t))return(await b_(t)).byteLength},Z$=async(t,e)=>{const n=ee.toFiniteNumber(t.getContentLength());return n??Q$(e)},eK=Nm&&(async t=>{let{url:e,method:n,data:r,signal:a,cancelToken:i,timeout:s,onDownloadProgress:o,onUploadProgress:l,responseType:u,headers:c,withCredentials:h="same-origin",fetchOptions:f}=SN(t);u=u?(u+"").toLowerCase():"text";let[p,g]=a||i||s?K$([a,i],s):[],m,_;const x=()=>{!m&&setTimeout(()=>{p&&p.unsubscribe()}),m=!0};let E;try{if(l&&X$&&n!=="get"&&n!=="head"&&(E=await Z$(c,r))!==0){let T=new Request(e,{method:"POST",body:r,duplex:"half"}),S;if(ee.isFormData(r)&&(S=T.headers.get("content-type"))&&c.setContentType(S),T.body){const[w,A]=p2(E,i0(m2(l)));r=v2(T.body,_2,w,A,b_)}}ee.isString(h)||(h=h?"include":"omit");const y="credentials"in Request.prototype;_=new Request(e,{...f,signal:p,method:n.toUpperCase(),headers:c.normalize().toJSON(),body:r,duplex:"half",credentials:y?h:void 0});let I=await fetch(_);const j=x_&&(u==="stream"||u==="response");if(x_&&(o||j)){const T={};["status","statusText","headers"].forEach(R=>{T[R]=I[R]});const S=ee.toFiniteNumber(I.headers.get("content-length")),[w,A]=o&&p2(S,i0(m2(o),!0))||[];I=new Response(v2(I.body,_2,w,()=>{A&&A(),j&&x()},b_),T)}u=u||"text";let G=await s0[ee.findKey(s0,u)||"text"](I,t);return!j&&x(),g&&g(),await new Promise((T,S)=>{bN(T,S,{data:G,headers:lr.from(I.headers),status:I.status,statusText:I.statusText,config:t,request:_})})}catch(y){throw x(),y&&y.name==="TypeError"&&/fetch/i.test(y.message)?Object.assign(new Be("Network Error",Be.ERR_NETWORK,t,_),{cause:y.cause||y}):Be.from(y,y&&y.code,t,_)}}),S_={http:v$,xhr:$$,fetch:eK};ee.forEach(S_,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const y2=t=>`- ${t}`,tK=t=>ee.isFunction(t)||t===null||t===!1,CN={getAdapter:t=>{t=ee.isArray(t)?t:[t];const{length:e}=t;let n,r;const a={};for(let i=0;i`adapter ${o} `+(l===!1?"is not supported by the environment":"is not available in the build"));let s=e?i.length>1?`since : `+i.map(y2).join(` `):" "+y2(i[0]):"as no adapter specified";throw new Be("There is no suitable adapter to dispatch the request "+s,"ERR_NOT_SUPPORT")}return r},adapters:S_};function sv(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new Au(null,t)}function E2(t){return sv(t),t.headers=lr.from(t.headers),t.data=iv.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),CN.getAdapter(t.adapter||yh.adapter)(t).then(function(r){return sv(t),r.data=iv.call(t,t.transformResponse,r),r.headers=lr.from(r.headers),r},function(r){return EN(r)||(sv(t),r&&r.response&&(r.response.data=iv.call(t,t.transformResponse,r.response),r.response.headers=lr.from(r.response.headers))),Promise.reject(r)})}const AN="1.7.5",hb={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{hb[t]=function(r){return typeof r===t||"a"+(e<1?"n ":" ")+t}});const b2={};hb.transitional=function(e,n,r){function a(i,s){return"[Axios v"+AN+"] Transitional option '"+i+"'"+s+(r?". "+r:"")}return(i,s,o)=>{if(e===!1)throw new Be(a(s," has been removed"+(n?" in "+n:"")),Be.ERR_DEPRECATED);return n&&!b2[s]&&(b2[s]=!0,console.warn(a(s," has been deprecated since v"+n+" and will be removed in the near future"))),e?e(i,s,o):!0}};function nK(t,e,n){if(typeof t!="object")throw new Be("options must be an object",Be.ERR_BAD_OPTION_VALUE);const r=Object.keys(t);let a=r.length;for(;a-- >0;){const i=r[a],s=e[i];if(s){const o=t[i],l=o===void 0||s(o,i,t);if(l!==!0)throw new Be("option "+i+" must be "+l,Be.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new Be("Unknown option "+i,Be.ERR_BAD_OPTION)}}const T_={assertOptions:nK,validators:hb},Ri=T_.validators;class uo{constructor(e){this.defaults=e,this.interceptors={request:new h2,response:new h2}}async request(e,n){try{return await this._request(e,n)}catch(r){if(r instanceof Error){let a;Error.captureStackTrace?Error.captureStackTrace(a={}):a=new Error;const i=a.stack?a.stack.replace(/^.+\n/,""):"";try{r.stack?i&&!String(r.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(r.stack+=` `+i):r.stack=i}catch{}}throw r}}_request(e,n){typeof e=="string"?(n=n||{},n.url=e):n=e||{},n=Ao(this.defaults,n);const{transitional:r,paramsSerializer:a,headers:i}=n;r!==void 0&&T_.assertOptions(r,{silentJSONParsing:Ri.transitional(Ri.boolean),forcedJSONParsing:Ri.transitional(Ri.boolean),clarifyTimeoutError:Ri.transitional(Ri.boolean)},!1),a!=null&&(ee.isFunction(a)?n.paramsSerializer={serialize:a}:T_.assertOptions(a,{encode:Ri.function,serialize:Ri.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let s=i&&ee.merge(i.common,i[n.method]);i&&ee.forEach(["delete","get","head","post","put","patch","common"],g=>{delete i[g]}),n.headers=lr.concat(s,i);const o=[];let l=!0;this.interceptors.request.forEach(function(m){typeof m.runWhen=="function"&&m.runWhen(n)===!1||(l=l&&m.synchronous,o.unshift(m.fulfilled,m.rejected))});const u=[];this.interceptors.response.forEach(function(m){u.push(m.fulfilled,m.rejected)});let c,h=0,f;if(!l){const g=[E2.bind(this),void 0];for(g.unshift.apply(g,o),g.push.apply(g,u),f=g.length,c=Promise.resolve(n);h{if(!r._listeners)return;let i=r._listeners.length;for(;i-- >0;)r._listeners[i](a);r._listeners=null}),this.promise.then=a=>{let i;const s=new Promise(o=>{r.subscribe(o),i=o}).then(a);return s.cancel=function(){r.unsubscribe(i)},s},e(function(i,s,o){r.reason||(r.reason=new Au(i,s,o),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const n=this._listeners.indexOf(e);n!==-1&&this._listeners.splice(n,1)}static source(){let e;return{token:new fb(function(a){e=a}),cancel:e}}}function rK(t){return function(n){return t.apply(null,n)}}function aK(t){return ee.isObject(t)&&t.isAxiosError===!0}const w_={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(w_).forEach(([t,e])=>{w_[e]=t});function IN(t){const e=new uo(t),n=iN(uo.prototype.request,e);return ee.extend(n,uo.prototype,e,{allOwnKeys:!0}),ee.extend(n,e,null,{allOwnKeys:!0}),n.create=function(a){return IN(Ao(t,a))},n}const Jt=IN(yh);Jt.Axios=uo;Jt.CanceledError=Au;Jt.CancelToken=fb;Jt.isCancel=EN;Jt.VERSION=AN;Jt.toFormData=km;Jt.AxiosError=Be;Jt.Cancel=Jt.CanceledError;Jt.all=function(e){return Promise.all(e)};Jt.spread=rK;Jt.isAxiosError=aK;Jt.mergeConfig=Ao;Jt.AxiosHeaders=lr;Jt.formToJSON=t=>yN(ee.isHTMLForm(t)?new FormData(t):t);Jt.getAdapter=CN.getAdapter;Jt.HttpStatusCode=w_;Jt.default=Jt;const Om=async(t,e)=>{const n={method:"get",maxBodyLength:1/0,url:`https://embvenmex.netlify.app/.netlify/functions${t}`,headers:{"x-api-key":"7Zz4B42D8Zh8h3o8Mv6P!TBcbZKEHWtCdtfitQdVzrJVY*a6Jj4tXzYPdiWoUFJ@@g@@hndkjcndhqwblcbhqw"},params:e};await Jt.request(n)},iK=(t,e,n,r)=>Om("/send-document",{url:r,name:t,lastName:e,email:n}),sK=(t,e,n)=>Om("/received-application",{email:t,name:e,lastName:n}),oK=(t,e,n)=>Om("/visa-approved",{email:t,name:e,lastName:n}),lK=(t,e,n)=>Om("/visa-rejected",{email:t,name:e,lastName:n}),Mm={Authorization:"Bearer patvgWmM3EzSqldqF.e9600736953f9ae22863bc47bfc4bd73e1bc0001c268d39c39c0305474f336c4","Content-Type":"application/json"},o0=async(t,e,n,r)=>{var l;const a=["sent","isToday"],i=[];let s=null;const o=async()=>{const u=new URL(`https://api.airtable.com/v0/${t}/${e}`);return u.searchParams.append("filterByFormula",`{${n}}='${r}'`),u.searchParams.append("pageSize","100"),s&&u.searchParams.append("offset",s),await(await fetch(u,{method:"GET",headers:Mm})).json()};do{const u=await o(),{records:c,offset:h}=u;i.push(...c),s=h}while(s);return a.includes(n)?(i.sort((u,c)=>new Date(u.fields.date)-new Date(c.fields.date)),i):(l=i[0])==null?void 0:l.fields},PN=async(t,e,n)=>{try{await fetch(`https://api.airtable.com/v0/${t}/${e}`,{method:"POST",headers:Mm,body:JSON.stringify({records:[{fields:{...n}}]})})}catch(r){console.log(r)}},x2=async(t,e,n,r,a)=>{await fetch(`https://api.airtable.com/v0/${t}/${e}/${n}`,{method:"PATCH",headers:Mm,body:JSON.stringify({fields:{sent:r,auth:a}})})},uK=async(t,e,n)=>{const r=await fetch(`https://api.airtable.com/v0/${t}/${e}?pageSize=1&sort[0][field]=${n}&sort[0][direction]=desc`,{method:"GET",headers:Mm}),{records:a}=await r.json();return a[0].fields.numero_nota},cK=(t,e)=>{const n=/^[^\s@]+@[^\s@]+\.[^\s@]+$/;return!t||!e?(Ie.error(hk),!1):n.test(t)?e.length<6?(Ie.error(wq),!1):!0:(Ie.error(jz),!1)},S2=async t=>{try{await d7(YE),t(tq,{replace:!0})}catch(e){console.log(e)}},dK=(t,e,n,r)=>{t.preventDefault(),Ie.dismiss(),cK(n,r)&&o7(YE,n,r).then(()=>{for(const i of wm){const{deparment:s,emails:o}=i;o.includes(n)&&e(s,{replace:!0})}}).catch(i=>{console.log(i.message),i.message===xq&&Ie.error(Eq)})},T2=async(t,e,n,r,a,i,s,o)=>{Ie.dismiss();const l=t.split(",");try{e(!0),o?(r==="visa_vzla"?await oK(l[3],l[1],l[2]):await iK(l[1],l[2],l[3],l[4]),await x2(n,r,l[0],Pq,s),Ie.success(yq)):(r==="visa_vzla"&&await lK(l[3],l[1],l[2]),await x2(n,r,l[0],Iq,s),Ie.error(Aq)),await a(),await i(),e(!1)}catch(u){Ie.error(u.message),e(!1),console.log(u)}},RN=({isValMenu:t=!1,numberOfPeople:e=!1})=>{const n=G0(),[r,a]=X.useState(!1),{email:[i],isMobile:[s],isScrolled:[o]}=X.useContext(yi),l=i&&wm.filter(h=>h.emails.includes(i)),u=t?l:fk,c=h=>{document.body.style.overflow=h?"hidden":"auto"};return X.useEffect(()=>{c(r)},[r]),O.jsx("div",{className:`navbar-container ${o&&!r?"opacity-75":""} ${t?"menu-alt-color":""}`,children:O.jsxs("div",{className:"navbar-inside-container",children:[s&&O.jsx(Zk,{}),O.jsx("img",{src:t?yW:_W,className:"menu-icon",onClick:()=>a(!0),alt:"Menu Icon"}),s?r&&O.jsx(i2,{setShowMenu:a,wichMenu:u,email:i,isValMenu:t,navigate:n,logout:S2,isMobile:s}):O.jsx(i2,{wichMenu:u,email:i,isValMenu:t,navigate:n,isMobile:s}),t&&!s&&O.jsx("button",{className:"btn-val logout-button-alt",onClick:()=>S2(n),children:dk}),i&&!t&&s&&O.jsx(Kl,{className:"link-menu alt-menu-icon",to:"/login",children:O.jsx(Bo,{icon:Qk})}),e&&O.jsx("p",{className:"number-people",children:e})]})})},pb=({children:t})=>O.jsxs("div",{className:"main-container",children:[O.jsx(pk,{}),O.jsx(RN,{}),t,O.jsx(Tm,{})]}),hK=()=>O.jsx(pb,{children:O.jsx($q,{})}),fK=()=>{const{pathname:t}=da();return X.useEffect(()=>{Ie.dismiss()},[t]),O.jsx(kW,{position:"top-right",autoClose:2e4,hideProgressBar:!1,newestOnTop:!1,closeOnClick:!0,rtl:!1,pauseOnFocusLoss:!1,draggable:!0,pauseOnHover:!0,theme:"light"})},Lm=({text:t})=>{const e=G0(),n=()=>{e("/",{replace:!0})};return O.jsxs("div",{className:"loader-container",children:[O.jsx("img",{src:uk,alt:zz}),O.jsx("p",{className:"success-text",dangerouslySetInnerHTML:{__html:t}}),O.jsx("button",{className:"home-button",onClick:n,children:Jz})]})},mb=({children:t})=>{const{email:[e],numberPeople:[n]}=X.useContext(yi),[r,a]=X.useState(""),[i,s]=X.useState(!0),{pathname:o}=da();return X.useEffect(()=>{const l=setTimeout(()=>{if(e){for(const u of wm){const{deparment:c,emails:h}=u;if(c===o&&h.includes(e)){a(e),s(!1);return}}a(null),s(!1)}else a(null),s(!1)},1e3);return()=>clearTimeout(l)},[o,e]),i?O.jsx(ca,{}):r===null?O.jsx(Lm,{text:XE}):O.jsxs("div",{children:[O.jsx(RN,{isValMenu:!0,numberOfPeople:n}),t,O.jsx(pk,{color:!0})]})};/*! xlsx.js (C) 2013-present SheetJS -- http://sheetjs.com */var l0={};l0.version="0.18.5";var kN=1252,pK=[874,932,936,949,950,1250,1251,1252,1253,1254,1255,1256,1257,1258,1e4],NN=function(t){pK.indexOf(t)!=-1&&(kN=t)};function mK(){NN(1252)}var Fd=function(t){NN(t)};function gK(){Fd(1200),mK()}var vf=function(e){return String.fromCharCode(e)},w2=function(e){return String.fromCharCode(e)},Hs,$i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function Bd(t){for(var e="",n=0,r=0,a=0,i=0,s=0,o=0,l=0,u=0;u>2,r=t.charCodeAt(u++),s=(n&3)<<4|r>>4,a=t.charCodeAt(u++),o=(r&15)<<2|a>>6,l=a&63,isNaN(r)?o=l=64:isNaN(a)&&(l=64),e+=$i.charAt(i)+$i.charAt(s)+$i.charAt(o)+$i.charAt(l);return e}function pi(t){var e="",n=0,r=0,a=0,i=0,s=0,o=0,l=0;t=t.replace(/[^\w\+\/\=]/g,"");for(var u=0;u>4,e+=String.fromCharCode(n),o=$i.indexOf(t.charAt(u++)),r=(s&15)<<4|o>>2,o!==64&&(e+=String.fromCharCode(r)),l=$i.indexOf(t.charAt(u++)),a=(o&3)<<6|l,l!==64&&(e+=String.fromCharCode(a));return e}var st=function(){return typeof Buffer<"u"&&typeof process<"u"&&typeof process.versions<"u"&&!!process.versions.node}(),bi=function(){if(typeof Buffer<"u"){var t=!Buffer.from;if(!t)try{Buffer.from("foo","utf8")}catch{t=!0}return t?function(e,n){return n?new Buffer(e,n):new Buffer(e)}:Buffer.from.bind(Buffer)}return function(){}}();function Io(t){return st?Buffer.alloc?Buffer.alloc(t):new Buffer(t):typeof Uint8Array<"u"?new Uint8Array(t):new Array(t)}function C2(t){return st?Buffer.allocUnsafe?Buffer.allocUnsafe(t):new Buffer(t):typeof Uint8Array<"u"?new Uint8Array(t):new Array(t)}var ea=function(e){return st?bi(e,"binary"):e.split("").map(function(n){return n.charCodeAt(0)&255})};function Dm(t){if(typeof ArrayBuffer>"u")return ea(t);for(var e=new ArrayBuffer(t.length),n=new Uint8Array(e),r=0;r!=t.length;++r)n[r]=t.charCodeAt(r)&255;return e}function Eh(t){if(Array.isArray(t))return t.map(function(r){return String.fromCharCode(r)}).join("");for(var e=[],n=0;n"u")throw new Error("Unsupported");return new Uint8Array(t)}var xn=st?function(t){return Buffer.concat(t.map(function(e){return Buffer.isBuffer(e)?e:bi(e)}))}:function(t){if(typeof Uint8Array<"u"){var e=0,n=0;for(e=0;e>6&31,a[n++]=128|s&63;else if(s>=55296&&s<57344){s=(s&1023)+64;var o=t.charCodeAt(++i)&1023;a[n++]=240|s>>8&7,a[n++]=128|s>>2&63,a[n++]=128|o>>6&15|(s&3)<<4,a[n++]=128|o&63}else a[n++]=224|s>>12&15,a[n++]=128|s>>6&63,a[n++]=128|s&63;n>r&&(e.push(a.slice(0,n)),n=0,a=Io(65535),r=65530)}return e.push(a.slice(0,n)),xn(e)}var qc=/\u0000/g,_f=/[\u0001-\u0006]/g;function Fl(t){for(var e="",n=t.length-1;n>=0;)e+=t.charAt(n--);return e}function ra(t,e){var n=""+t;return n.length>=e?n:Dt("0",e-n.length)+n}function gb(t,e){var n=""+t;return n.length>=e?n:Dt(" ",e-n.length)+n}function u0(t,e){var n=""+t;return n.length>=e?n:n+Dt(" ",e-n.length)}function yK(t,e){var n=""+Math.round(t);return n.length>=e?n:Dt("0",e-n.length)+n}function EK(t,e){var n=""+t;return n.length>=e?n:Dt("0",e-n.length)+n}var A2=Math.pow(2,32);function Zo(t,e){if(t>A2||t<-A2)return yK(t,e);var n=Math.round(t);return EK(n,e)}function c0(t,e){return e=e||0,t.length>=7+e&&(t.charCodeAt(e)|32)===103&&(t.charCodeAt(e+1)|32)===101&&(t.charCodeAt(e+2)|32)===110&&(t.charCodeAt(e+3)|32)===101&&(t.charCodeAt(e+4)|32)===114&&(t.charCodeAt(e+5)|32)===97&&(t.charCodeAt(e+6)|32)===108}var I2=[["Sun","Sunday"],["Mon","Monday"],["Tue","Tuesday"],["Wed","Wednesday"],["Thu","Thursday"],["Fri","Friday"],["Sat","Saturday"]],ov=[["J","Jan","January"],["F","Feb","February"],["M","Mar","March"],["A","Apr","April"],["M","May","May"],["J","Jun","June"],["J","Jul","July"],["A","Aug","August"],["S","Sep","September"],["O","Oct","October"],["N","Nov","November"],["D","Dec","December"]];function bK(t){return t||(t={}),t[0]="General",t[1]="0",t[2]="0.00",t[3]="#,##0",t[4]="#,##0.00",t[9]="0%",t[10]="0.00%",t[11]="0.00E+00",t[12]="# ?/?",t[13]="# ??/??",t[14]="m/d/yy",t[15]="d-mmm-yy",t[16]="d-mmm",t[17]="mmm-yy",t[18]="h:mm AM/PM",t[19]="h:mm:ss AM/PM",t[20]="h:mm",t[21]="h:mm:ss",t[22]="m/d/yy h:mm",t[37]="#,##0 ;(#,##0)",t[38]="#,##0 ;[Red](#,##0)",t[39]="#,##0.00;(#,##0.00)",t[40]="#,##0.00;[Red](#,##0.00)",t[45]="mm:ss",t[46]="[h]:mm:ss",t[47]="mmss.0",t[48]="##0.0E+0",t[49]="@",t[56]='"上午/下午 "hh"時"mm"分"ss"秒 "',t}var Bt={0:"General",1:"0",2:"0.00",3:"#,##0",4:"#,##0.00",9:"0%",10:"0.00%",11:"0.00E+00",12:"# ?/?",13:"# ??/??",14:"m/d/yy",15:"d-mmm-yy",16:"d-mmm",17:"mmm-yy",18:"h:mm AM/PM",19:"h:mm:ss AM/PM",20:"h:mm",21:"h:mm:ss",22:"m/d/yy h:mm",37:"#,##0 ;(#,##0)",38:"#,##0 ;[Red](#,##0)",39:"#,##0.00;(#,##0.00)",40:"#,##0.00;[Red](#,##0.00)",45:"mm:ss",46:"[h]:mm:ss",47:"mmss.0",48:"##0.0E+0",49:"@",56:'"上午/下午 "hh"時"mm"分"ss"秒 "'},P2={5:37,6:38,7:39,8:40,23:0,24:0,25:0,26:0,27:14,28:14,29:14,30:14,31:14,50:14,51:14,52:14,53:14,54:14,55:14,56:14,57:14,58:14,59:1,60:2,61:3,62:4,67:9,68:10,69:12,70:13,71:14,72:14,73:15,74:16,75:17,76:20,77:21,78:22,79:45,80:46,81:47,82:0},xK={5:'"$"#,##0_);\\("$"#,##0\\)',63:'"$"#,##0_);\\("$"#,##0\\)',6:'"$"#,##0_);[Red]\\("$"#,##0\\)',64:'"$"#,##0_);[Red]\\("$"#,##0\\)',7:'"$"#,##0.00_);\\("$"#,##0.00\\)',65:'"$"#,##0.00_);\\("$"#,##0.00\\)',8:'"$"#,##0.00_);[Red]\\("$"#,##0.00\\)',66:'"$"#,##0.00_);[Red]\\("$"#,##0.00\\)',41:'_(* #,##0_);_(* \\(#,##0\\);_(* "-"_);_(@_)',42:'_("$"* #,##0_);_("$"* \\(#,##0\\);_("$"* "-"_);_(@_)',43:'_(* #,##0.00_);_(* \\(#,##0.00\\);_(* "-"??_);_(@_)',44:'_("$"* #,##0.00_);_("$"* \\(#,##0.00\\);_("$"* "-"??_);_(@_)'};function d0(t,e,n){for(var r=t<0?-1:1,a=t*r,i=0,s=1,o=0,l=1,u=0,c=0,h=Math.floor(a);ue&&(u>e?(c=l,o=i):(c=u,o=s)),!n)return[0,r*o,c];var f=Math.floor(r*o/c);return[f,r*o-f*c,c]}function yf(t,e,n){if(t>2958465||t<0)return null;var r=t|0,a=Math.floor(86400*(t-r)),i=0,s=[],o={D:r,T:a,u:86400*(t-r)-a,y:0,m:0,d:0,H:0,M:0,S:0,q:0};if(Math.abs(o.u)<1e-6&&(o.u=0),e&&e.date1904&&(r+=1462),o.u>.9999&&(o.u=0,++a==86400&&(o.T=a=0,++r,++o.D)),r===60)s=n?[1317,10,29]:[1900,2,29],i=3;else if(r===0)s=n?[1317,8,29]:[1900,1,0],i=6;else{r>60&&--r;var l=new Date(1900,0,1);l.setDate(l.getDate()+r-1),s=[l.getFullYear(),l.getMonth()+1,l.getDate()],i=l.getDay(),r<60&&(i=(i+6)%7),n&&(i=PK(l,s))}return o.y=s[0],o.m=s[1],o.d=s[2],o.S=a%60,a=Math.floor(a/60),o.M=a%60,a=Math.floor(a/60),o.H=a,o.q=i,o}var ON=new Date(1899,11,31,0,0,0),SK=ON.getTime(),TK=new Date(1900,2,1,0,0,0);function MN(t,e){var n=t.getTime();return e?n-=1461*24*60*60*1e3:t>=TK&&(n+=24*60*60*1e3),(n-(SK+(t.getTimezoneOffset()-ON.getTimezoneOffset())*6e4))/(24*60*60*1e3)}function vb(t){return t.indexOf(".")==-1?t:t.replace(/(?:\.0*|(\.\d*[1-9])0+)$/,"$1")}function wK(t){return t.indexOf("E")==-1?t:t.replace(/(?:\.0*|(\.\d*[1-9])0+)[Ee]/,"$1E").replace(/(E[+-])(\d)$/,"$10$2")}function CK(t){var e=t<0?12:11,n=vb(t.toFixed(12));return n.length<=e||(n=t.toPrecision(10),n.length<=e)?n:t.toExponential(5)}function AK(t){var e=vb(t.toFixed(11));return e.length>(t<0?12:11)||e==="0"||e==="-0"?t.toPrecision(6):e}function IK(t){var e=Math.floor(Math.log(Math.abs(t))*Math.LOG10E),n;return e>=-4&&e<=-1?n=t.toPrecision(10+e):Math.abs(e)<=9?n=CK(t):e===10?n=t.toFixed(10).substr(0,12):n=AK(t),vb(wK(n.toUpperCase()))}function C_(t,e){switch(typeof t){case"string":return t;case"boolean":return t?"TRUE":"FALSE";case"number":return(t|0)===t?t.toString(10):IK(t);case"undefined":return"";case"object":if(t==null)return"";if(t instanceof Date)return xs(14,MN(t,e&&e.date1904),e)}throw new Error("unsupported value in General format: "+t)}function PK(t,e){e[0]-=581;var n=t.getDay();return t<60&&(n=(n+6)%7),n}function RK(t,e,n,r){var a="",i=0,s=0,o=n.y,l,u=0;switch(t){case 98:o=n.y+543;case 121:switch(e.length){case 1:case 2:l=o%100,u=2;break;default:l=o%1e4,u=4;break}break;case 109:switch(e.length){case 1:case 2:l=n.m,u=e.length;break;case 3:return ov[n.m-1][1];case 5:return ov[n.m-1][0];default:return ov[n.m-1][2]}break;case 100:switch(e.length){case 1:case 2:l=n.d,u=e.length;break;case 3:return I2[n.q][0];default:return I2[n.q][1]}break;case 104:switch(e.length){case 1:case 2:l=1+(n.H+11)%12,u=e.length;break;default:throw"bad hour format: "+e}break;case 72:switch(e.length){case 1:case 2:l=n.H,u=e.length;break;default:throw"bad hour format: "+e}break;case 77:switch(e.length){case 1:case 2:l=n.M,u=e.length;break;default:throw"bad minute format: "+e}break;case 115:if(e!="s"&&e!="ss"&&e!=".0"&&e!=".00"&&e!=".000")throw"bad second format: "+e;return n.u===0&&(e=="s"||e=="ss")?ra(n.S,e.length):(r>=2?s=r===3?1e3:100:s=r===1?10:1,i=Math.round(s*(n.S+n.u)),i>=60*s&&(i=0),e==="s"?i===0?"0":""+i/s:(a=ra(i,2+r),e==="ss"?a.substr(0,2):"."+a.substr(2,e.length-1)));case 90:switch(e){case"[h]":case"[hh]":l=n.D*24+n.H;break;case"[m]":case"[mm]":l=(n.D*24+n.H)*60+n.M;break;case"[s]":case"[ss]":l=((n.D*24+n.H)*60+n.M)*60+Math.round(n.S+n.u);break;default:throw"bad abstime format: "+e}u=e.length===3?1:2;break;case 101:l=o,u=1;break}var c=u>0?ra(l,u):"";return c}function Ki(t){var e=3;if(t.length<=e)return t;for(var n=t.length%e,r=t.substr(0,n);n!=t.length;n+=e)r+=(r.length>0?",":"")+t.substr(n,e);return r}var LN=/%/g;function kK(t,e,n){var r=e.replace(LN,""),a=e.length-r.length;return ti(t,r,n*Math.pow(10,2*a))+Dt("%",a)}function NK(t,e,n){for(var r=e.length-1;e.charCodeAt(r-1)===44;)--r;return ti(t,e.substr(0,r),n/Math.pow(10,3*(e.length-r)))}function DN(t,e){var n,r=t.indexOf("E")-t.indexOf(".")-1;if(t.match(/^#+0.0E\+0$/)){if(e==0)return"0.0E+0";if(e<0)return"-"+DN(t,-e);var a=t.indexOf(".");a===-1&&(a=t.indexOf("E"));var i=Math.floor(Math.log(e)*Math.LOG10E)%a;if(i<0&&(i+=a),n=(e/Math.pow(10,i)).toPrecision(r+1+(a+i)%a),n.indexOf("e")===-1){var s=Math.floor(Math.log(e)*Math.LOG10E);for(n.indexOf(".")===-1?n=n.charAt(0)+"."+n.substr(1)+"E+"+(s-n.length+i):n+="E+"+(s-i);n.substr(0,2)==="0.";)n=n.charAt(0)+n.substr(2,a)+"."+n.substr(2+a),n=n.replace(/^0+([1-9])/,"$1").replace(/^0+\./,"0.");n=n.replace(/\+-/,"-")}n=n.replace(/^([+-]?)(\d*)\.(\d*)[Ee]/,function(o,l,u,c){return l+u+c.substr(0,(a+i)%a)+"."+c.substr(i)+"E"})}else n=e.toExponential(r);return t.match(/E\+00$/)&&n.match(/e[+-]\d$/)&&(n=n.substr(0,n.length-1)+"0"+n.charAt(n.length-1)),t.match(/E\-/)&&n.match(/e\+/)&&(n=n.replace(/e\+/,"e")),n.replace("e","E")}var FN=/# (\?+)( ?)\/( ?)(\d+)/;function OK(t,e,n){var r=parseInt(t[4],10),a=Math.round(e*r),i=Math.floor(a/r),s=a-i*r,o=r;return n+(i===0?"":""+i)+" "+(s===0?Dt(" ",t[1].length+1+t[4].length):gb(s,t[1].length)+t[2]+"/"+t[3]+ra(o,t[4].length))}function MK(t,e,n){return n+(e===0?"":""+e)+Dt(" ",t[1].length+2+t[4].length)}var BN=/^#*0*\.([0#]+)/,UN=/\).*[0#]/,VN=/\(###\) ###\\?-####/;function Gn(t){for(var e="",n,r=0;r!=t.length;++r)switch(n=t.charCodeAt(r)){case 35:break;case 63:e+=" ";break;case 48:e+="0";break;default:e+=String.fromCharCode(n)}return e}function R2(t,e){var n=Math.pow(10,e);return""+Math.round(t*n)/n}function k2(t,e){var n=t-Math.floor(t),r=Math.pow(10,e);return e<(""+Math.round(n*r)).length?0:Math.round(n*r)}function LK(t,e){return e<(""+Math.round((t-Math.floor(t))*Math.pow(10,e))).length?1:0}function DK(t){return t<2147483647&&t>-2147483648?""+(t>=0?t|0:t-1|0):""+Math.floor(t)}function Dr(t,e,n){if(t.charCodeAt(0)===40&&!e.match(UN)){var r=e.replace(/\( */,"").replace(/ \)/,"").replace(/\)/,"");return n>=0?Dr("n",r,n):"("+Dr("n",r,-n)+")"}if(e.charCodeAt(e.length-1)===44)return NK(t,e,n);if(e.indexOf("%")!==-1)return kK(t,e,n);if(e.indexOf("E")!==-1)return DN(e,n);if(e.charCodeAt(0)===36)return"$"+Dr(t,e.substr(e.charAt(1)==" "?2:1),n);var a,i,s,o,l=Math.abs(n),u=n<0?"-":"";if(e.match(/^00+$/))return u+Zo(l,e.length);if(e.match(/^[#?]+$/))return a=Zo(n,0),a==="0"&&(a=""),a.length>e.length?a:Gn(e.substr(0,e.length-a.length))+a;if(i=e.match(FN))return OK(i,l,u);if(e.match(/^#+0+$/))return u+Zo(l,e.length-e.indexOf("0"));if(i=e.match(BN))return a=R2(n,i[1].length).replace(/^([^\.]+)$/,"$1."+Gn(i[1])).replace(/\.$/,"."+Gn(i[1])).replace(/\.(\d*)$/,function(g,m){return"."+m+Dt("0",Gn(i[1]).length-m.length)}),e.indexOf("0.")!==-1?a:a.replace(/^0\./,".");if(e=e.replace(/^#+([0.])/,"$1"),i=e.match(/^(0*)\.(#*)$/))return u+R2(l,i[2].length).replace(/\.(\d*[1-9])0*$/,".$1").replace(/^(-?\d*)$/,"$1.").replace(/^0\./,i[1].length?"0.":".");if(i=e.match(/^#{1,3},##0(\.?)$/))return u+Ki(Zo(l,0));if(i=e.match(/^#,##0\.([#0]*0)$/))return n<0?"-"+Dr(t,e,-n):Ki(""+(Math.floor(n)+LK(n,i[1].length)))+"."+ra(k2(n,i[1].length),i[1].length);if(i=e.match(/^#,#*,#0/))return Dr(t,e.replace(/^#,#*,/,""),n);if(i=e.match(/^([0#]+)(\\?-([0#]+))+$/))return a=Fl(Dr(t,e.replace(/[\\-]/g,""),n)),s=0,Fl(Fl(e.replace(/\\/g,"")).replace(/[0#]/g,function(g){return s=0?ma("n",r,n):"("+ma("n",r,-n)+")"}if(e.charCodeAt(e.length-1)===44)return FK(t,e,n);if(e.indexOf("%")!==-1)return BK(t,e,n);if(e.indexOf("E")!==-1)return jN(e,n);if(e.charCodeAt(0)===36)return"$"+ma(t,e.substr(e.charAt(1)==" "?2:1),n);var a,i,s,o,l=Math.abs(n),u=n<0?"-":"";if(e.match(/^00+$/))return u+ra(l,e.length);if(e.match(/^[#?]+$/))return a=""+n,n===0&&(a=""),a.length>e.length?a:Gn(e.substr(0,e.length-a.length))+a;if(i=e.match(FN))return MK(i,l,u);if(e.match(/^#+0+$/))return u+ra(l,e.length-e.indexOf("0"));if(i=e.match(BN))return a=(""+n).replace(/^([^\.]+)$/,"$1."+Gn(i[1])).replace(/\.$/,"."+Gn(i[1])),a=a.replace(/\.(\d*)$/,function(g,m){return"."+m+Dt("0",Gn(i[1]).length-m.length)}),e.indexOf("0.")!==-1?a:a.replace(/^0\./,".");if(e=e.replace(/^#+([0.])/,"$1"),i=e.match(/^(0*)\.(#*)$/))return u+(""+l).replace(/\.(\d*[1-9])0*$/,".$1").replace(/^(-?\d*)$/,"$1.").replace(/^0\./,i[1].length?"0.":".");if(i=e.match(/^#{1,3},##0(\.?)$/))return u+Ki(""+l);if(i=e.match(/^#,##0\.([#0]*0)$/))return n<0?"-"+ma(t,e,-n):Ki(""+n)+"."+Dt("0",i[1].length);if(i=e.match(/^#,#*,#0/))return ma(t,e.replace(/^#,#*,/,""),n);if(i=e.match(/^([0#]+)(\\?-([0#]+))+$/))return a=Fl(ma(t,e.replace(/[\\-]/g,""),n)),s=0,Fl(Fl(e.replace(/\\/g,"")).replace(/[0#]/g,function(g){return s-1||n=="\\"&&t.charAt(e+1)=="-"&&"0#".indexOf(t.charAt(e+2))>-1););break;case"?":for(;t.charAt(++e)===n;);break;case"*":++e,(t.charAt(e)==" "||t.charAt(e)=="*")&&++e;break;case"(":case")":++e;break;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":for(;e-1;);break;case" ":++e;break;default:++e;break}return!1}function VK(t,e,n,r){for(var a=[],i="",s=0,o="",l="t",u,c,h,f="H";s=12?"P":"A"),m.t="T",f="h",s+=3):t.substr(s,5).toUpperCase()==="AM/PM"?(u!=null&&(m.v=u.H>=12?"PM":"AM"),m.t="T",s+=5,f="h"):t.substr(s,5).toUpperCase()==="上午/下午"?(u!=null&&(m.v=u.H>=12?"下午":"上午"),m.t="T",s+=5,f="h"):(m.t="t",++s),u==null&&m.t==="T")return"";a[a.length]=m,l=o;break;case"[":for(i=o;t.charAt(s++)!=="]"&&s-1&&(i=(i.match(/\$([^-\[\]]*)/)||[])[1]||"$",qN(t)||(a[a.length]={t:"t",v:i}));break;case".":if(u!=null){for(i=o;++s-1;)i+=o;a[a.length]={t:"n",v:i};break;case"?":for(i=o;t.charAt(++s)===o;)i+=o;a[a.length]={t:o,v:i},l=o;break;case"*":++s,(t.charAt(s)==" "||t.charAt(s)=="*")&&++s;break;case"(":case")":a[a.length]={t:r===1?"t":o,v:o},++s;break;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":for(i=o;s-1;)i+=t.charAt(s);a[a.length]={t:"D",v:i};break;case" ":a[a.length]={t:o,v:o},++s;break;case"$":a[a.length]={t:"t",v:"$"},++s;break;default:if(",$-+/():!^&'~{}<>=€acfijklopqrtuvwxzP".indexOf(o)===-1)throw new Error("unrecognized character "+o+" in "+t);a[a.length]={t:"t",v:o},++s;break}var _=0,x=0,E;for(s=a.length-1,l="t";s>=0;--s)switch(a[s].t){case"h":case"H":a[s].t=f,l="h",_<1&&(_=1);break;case"s":(E=a[s].v.match(/\.0+$/))&&(x=Math.max(x,E[0].length-1)),_<3&&(_=3);case"d":case"y":case"M":case"e":l=a[s].t;break;case"m":l==="s"&&(a[s].t="M",_<2&&(_=2));break;case"X":break;case"Z":_<1&&a[s].v.match(/[Hh]/)&&(_=1),_<2&&a[s].v.match(/[Mm]/)&&(_=2),_<3&&a[s].v.match(/[Ss]/)&&(_=3)}switch(_){case 0:break;case 1:u.u>=.5&&(u.u=0,++u.S),u.S>=60&&(u.S=0,++u.M),u.M>=60&&(u.M=0,++u.H);break;case 2:u.u>=.5&&(u.u=0,++u.S),u.S>=60&&(u.S=0,++u.M);break}var y="",I;for(s=0;s0){y.charCodeAt(0)==40?(G=e<0&&y.charCodeAt(0)===45?-e:e,T=ti("n",y,G)):(G=e<0&&r>1?-e:e,T=ti("n",y,G),G<0&&a[0]&&a[0].t=="t"&&(T=T.substr(1),a[0].v="-"+a[0].v)),I=T.length-1;var S=a.length;for(s=0;s-1){S=s;break}var w=a.length;if(S===a.length&&T.indexOf("E")===-1){for(s=a.length-1;s>=0;--s)a[s]==null||"n?".indexOf(a[s].t)===-1||(I>=a[s].v.length-1?(I-=a[s].v.length,a[s].v=T.substr(I+1,a[s].v.length)):I<0?a[s].v="":(a[s].v=T.substr(0,I+1),I=-1),a[s].t="t",w=s);I>=0&&w=0;--s)if(!(a[s]==null||"n?".indexOf(a[s].t)===-1)){for(c=a[s].v.indexOf(".")>-1&&s===S?a[s].v.indexOf(".")-1:a[s].v.length-1,j=a[s].v.substr(c+1);c>=0;--c)I>=0&&(a[s].v.charAt(c)==="0"||a[s].v.charAt(c)==="#")&&(j=T.charAt(I--)+j);a[s].v=j,a[s].t="t",w=s}for(I>=0&&w-1&&s===S?a[s].v.indexOf(".")+1:0,j=a[s].v.substr(0,c);c-1&&(G=r>1&&e<0&&s>0&&a[s-1].v==="-"?-e:e,a[s].v=ti(a[s].t,a[s].v,G),a[s].t="t");var A="";for(s=0;s!==a.length;++s)a[s]!=null&&(A+=a[s].v);return A}var N2=/\[(=|>[=]?|<[>=]?)(-?\d+(?:\.\d*)?)\]/;function O2(t,e){if(e==null)return!1;var n=parseFloat(e[2]);switch(e[1]){case"=":if(t==n)return!0;break;case">":if(t>n)return!0;break;case"<":if(t":if(t!=n)return!0;break;case">=":if(t>=n)return!0;break;case"<=":if(t<=n)return!0;break}return!1}function jK(t,e){var n=UK(t),r=n.length,a=n[r-1].indexOf("@");if(r<4&&a>-1&&--r,n.length>4)throw new Error("cannot find right format for |"+n.join("|")+"|");if(typeof e!="number")return[4,n.length===4||a>-1?n[n.length-1]:"@"];switch(n.length){case 1:n=a>-1?["General","General","General",n[0]]:[n[0],n[0],n[0],"@"];break;case 2:n=a>-1?[n[0],n[0],n[0],n[1]]:[n[0],n[1],n[0],"@"];break;case 3:n=a>-1?[n[0],n[1],n[0],n[2]]:[n[0],n[1],n[2],"@"];break}var i=e>0?n[0]:e<0?n[1]:n[2];if(n[0].indexOf("[")===-1&&n[1].indexOf("[")===-1)return[r,i];if(n[0].match(/\[[=<>]/)!=null||n[1].match(/\[[=<>]/)!=null){var s=n[0].match(N2),o=n[1].match(N2);return O2(e,s)?[r,n[0]]:O2(e,o)?[r,n[1]]:[r,n[s!=null&&o!=null?2:1]]}return[r,i]}function xs(t,e,n){n==null&&(n={});var r="";switch(typeof t){case"string":t=="m/d/yy"&&n.dateNF?r=n.dateNF:r=t;break;case"number":t==14&&n.dateNF?r=n.dateNF:r=(n.table!=null?n.table:Bt)[t],r==null&&(r=n.table&&n.table[P2[t]]||Bt[P2[t]]),r==null&&(r=xK[t]||"General");break}if(c0(r,0))return C_(e,n);e instanceof Date&&(e=MN(e,n.date1904));var a=jK(r,e);if(c0(a[1]))return C_(e,n);if(e===!0)e="TRUE";else if(e===!1)e="FALSE";else if(e===""||e==null)return"";return VK(a[1],e,n,a[0])}function GN(t,e){if(typeof e!="number"){e=+e||-1;for(var n=0;n<392;++n){if(Bt[n]==null){e<0&&(e=n);continue}if(Bt[n]==t){e=n;break}}e<0&&(e=391)}return Bt[e]=t,e}function Fm(t){for(var e=0;e!=392;++e)t[e]!==void 0&&GN(t[e],e)}function Bm(){Bt=bK()}var HN=/[dD]+|[mM]+|[yYeE]+|[Hh]+|[Ss]+/g;function zK(t){var e=typeof t=="number"?Bt[t]:t;return e=e.replace(HN,"(\\d+)"),new RegExp("^"+e+"$")}function qK(t,e,n){var r=-1,a=-1,i=-1,s=-1,o=-1,l=-1;(e.match(HN)||[]).forEach(function(h,f){var p=parseInt(n[f+1],10);switch(h.toLowerCase().charAt(0)){case"y":r=p;break;case"d":i=p;break;case"h":s=p;break;case"s":l=p;break;case"m":s>=0?o=p:a=p;break}}),l>=0&&o==-1&&a>=0&&(o=a,a=-1);var u=(""+(r>=0?r:new Date().getFullYear())).slice(-4)+"-"+("00"+(a>=1?a:1)).slice(-2)+"-"+("00"+(i>=1?i:1)).slice(-2);u.length==7&&(u="0"+u),u.length==8&&(u="20"+u);var c=("00"+(s>=0?s:0)).slice(-2)+":"+("00"+(o>=0?o:0)).slice(-2)+":"+("00"+(l>=0?l:0)).slice(-2);return s==-1&&o==-1&&l==-1?u:r==-1&&a==-1&&i==-1?c:u+"T"+c}var GK=function(){var t={};t.version="1.2.0";function e(){for(var T=0,S=new Array(256),w=0;w!=256;++w)T=w,T=T&1?-306674912^T>>>1:T>>>1,T=T&1?-306674912^T>>>1:T>>>1,T=T&1?-306674912^T>>>1:T>>>1,T=T&1?-306674912^T>>>1:T>>>1,T=T&1?-306674912^T>>>1:T>>>1,T=T&1?-306674912^T>>>1:T>>>1,T=T&1?-306674912^T>>>1:T>>>1,T=T&1?-306674912^T>>>1:T>>>1,S[w]=T;return typeof Int32Array<"u"?new Int32Array(S):S}var n=e();function r(T){var S=0,w=0,A=0,R=typeof Int32Array<"u"?new Int32Array(4096):new Array(4096);for(A=0;A!=256;++A)R[A]=T[A];for(A=0;A!=256;++A)for(w=T[A],S=256+A;S<4096;S+=256)w=R[S]=w>>>8^T[w&255];var L=[];for(A=1;A!=16;++A)L[A-1]=typeof Int32Array<"u"?R.subarray(A*256,A*256+256):R.slice(A*256,A*256+256);return L}var a=r(n),i=a[0],s=a[1],o=a[2],l=a[3],u=a[4],c=a[5],h=a[6],f=a[7],p=a[8],g=a[9],m=a[10],_=a[11],x=a[12],E=a[13],y=a[14];function I(T,S){for(var w=S^-1,A=0,R=T.length;A>>8^n[(w^T.charCodeAt(A++))&255];return~w}function j(T,S){for(var w=S^-1,A=T.length-15,R=0;R>8&255]^x[T[R++]^w>>16&255]^_[T[R++]^w>>>24]^m[T[R++]]^g[T[R++]]^p[T[R++]]^f[T[R++]]^h[T[R++]]^c[T[R++]]^u[T[R++]]^l[T[R++]]^o[T[R++]]^s[T[R++]]^i[T[R++]]^n[T[R++]];for(A+=15;R>>8^n[(w^T[R++])&255];return~w}function G(T,S){for(var w=S^-1,A=0,R=T.length,L=0,N=0;A>>8^n[(w^L)&255]:L<2048?(w=w>>>8^n[(w^(192|L>>6&31))&255],w=w>>>8^n[(w^(128|L&63))&255]):L>=55296&&L<57344?(L=(L&1023)+64,N=T.charCodeAt(A++)&1023,w=w>>>8^n[(w^(240|L>>8&7))&255],w=w>>>8^n[(w^(128|L>>2&63))&255],w=w>>>8^n[(w^(128|N>>6&15|(L&3)<<4))&255],w=w>>>8^n[(w^(128|N&63))&255]):(w=w>>>8^n[(w^(224|L>>12&15))&255],w=w>>>8^n[(w^(128|L>>6&63))&255],w=w>>>8^n[(w^(128|L&63))&255]);return~w}return t.table=n,t.bstr=I,t.buf=j,t.str=G,t}(),pt=function(){var e={};e.version="1.2.1";function n(C,D){for(var k=C.split("/"),M=D.split("/"),F=0,U=0,K=Math.min(k.length,M.length);F>>1,C.write_shift(2,k);var M=D.getFullYear()-1980;M=M<<4|D.getMonth()+1,M=M<<5|D.getDate(),C.write_shift(2,M)}function s(C){var D=C.read_shift(2)&65535,k=C.read_shift(2)&65535,M=new Date,F=k&31;k>>>=5;var U=k&15;k>>>=4,M.setMilliseconds(0),M.setFullYear(k+1980),M.setMonth(U-1),M.setDate(F);var K=D&31;D>>>=5;var te=D&63;return D>>>=6,M.setHours(D),M.setMinutes(te),M.setSeconds(K<<1),M}function o(C){yr(C,0);for(var D={},k=0;C.l<=C.length-4;){var M=C.read_shift(2),F=C.read_shift(2),U=C.l+F,K={};switch(M){case 21589:k=C.read_shift(1),k&1&&(K.mtime=C.read_shift(4)),F>5&&(k&2&&(K.atime=C.read_shift(4)),k&4&&(K.ctime=C.read_shift(4))),K.mtime&&(K.mt=new Date(K.mtime*1e3));break}C.l=U,D[M]=K}return D}var l;function u(){return l||(l={})}function c(C,D){if(C[0]==80&&C[1]==75)return Du(C,D);if((C[0]|32)==109&&(C[1]|32)==105)return kh(C,D);if(C.length<512)throw new Error("CFB file size "+C.length+" < 512");var k=3,M=512,F=0,U=0,K=0,te=0,J=0,Y=[],Q=C.slice(0,512);yr(Q,0);var se=h(Q);switch(k=se[0],k){case 3:M=512;break;case 4:M=4096;break;case 0:if(se[1]==0)return Du(C,D);default:throw new Error("Major Version: Expected 3 or 4 saw "+k)}M!==512&&(Q=C.slice(0,M),yr(Q,28));var fe=C.slice(0,M);f(Q,k);var Ee=Q.read_shift(4,"i");if(k===3&&Ee!==0)throw new Error("# Directory Sectors: Expected 0 saw "+Ee);Q.l+=4,K=Q.read_shift(4,"i"),Q.l+=4,Q.chk("00100000","Mini Stream Cutoff Size: "),te=Q.read_shift(4,"i"),F=Q.read_shift(4,"i"),J=Q.read_shift(4,"i"),U=Q.read_shift(4,"i");for(var ue=-1,ge=0;ge<109&&(ue=Q.read_shift(4,"i"),!(ue<0));++ge)Y[ge]=ue;var Le=p(C,M);_(J,U,Le,M,Y);var mt=E(Le,K,Y,M);mt[K].name="!Directory",F>0&&te!==N&&(mt[te].name="!MiniFAT"),mt[Y[0]].name="!FAT",mt.fat_addrs=Y,mt.ssz=M;var ot={},At=[],Ua=[],Ds=[];y(K,mt,Le,At,F,ot,Ua,te),g(Ua,Ds,At),At.shift();var Ti={FileIndex:Ua,FullPaths:Ds};return D&&D.raw&&(Ti.raw={header:fe,sectors:Le}),Ti}function h(C){if(C[C.l]==80&&C[C.l+1]==75)return[0,0];C.chk(Re,"Header Signature: "),C.l+=16;var D=C.read_shift(2,"u");return[C.read_shift(2,"u"),D]}function f(C,D){var k=9;switch(C.l+=2,k=C.read_shift(2)){case 9:if(D!=3)throw new Error("Sector Shift: Expected 9 saw "+k);break;case 12:if(D!=4)throw new Error("Sector Shift: Expected 12 saw "+k);break;default:throw new Error("Sector Shift: Expected 9 or 12 saw "+k)}C.chk("0600","Mini Sector Shift: "),C.chk("000000000000","Reserved: ")}function p(C,D){for(var k=Math.ceil(C.length/D)-1,M=[],F=1;F0&&K>=0;)U.push(D.slice(K*L,K*L+L)),F-=L,K=Ws(k,K*4);return U.length===0?ne(0):xn(U).slice(0,C.size)}function _(C,D,k,M,F){var U=N;if(C===N){if(D!==0)throw new Error("DIFAT chain shorter than expected")}else if(C!==-1){var K=k[C],te=(M>>>2)-1;if(!K)return;for(var J=0;J=0;){F[J]=!0,U[U.length]=J,K.push(C[J]);var Q=k[Math.floor(J*4/M)];if(Y=J*4&te,M<4+Y)throw new Error("FAT boundary crossed: "+J+" 4 "+M);if(!C[Q])break;J=Ws(C[Q],Y)}return{nodes:U,data:j2([K])}}function E(C,D,k,M){var F=C.length,U=[],K=[],te=[],J=[],Y=M-1,Q=0,se=0,fe=0,Ee=0;for(Q=0;Q=F&&(fe-=F),!K[fe]){J=[];var ue=[];for(se=fe;se>=0;){ue[se]=!0,K[se]=!0,te[te.length]=se,J.push(C[se]);var ge=k[Math.floor(se*4/M)];if(Ee=se*4&Y,M<4+Ee)throw new Error("FAT boundary crossed: "+se+" 4 "+M);if(!C[ge]||(se=Ws(C[ge],Ee),ue[se]))break}U[fe]={nodes:te,data:j2([J])}}return U}function y(C,D,k,M,F,U,K,te){for(var J=0,Y=M.length?2:0,Q=D[C].data,se=0,fe=0,Ee;se0&&J!==N&&(D[J].name="!StreamData")):ge.size>=4096?(ge.storage="fat",D[ge.start]===void 0&&(D[ge.start]=x(k,ge.start,D.fat_addrs,D.ssz)),D[ge.start].name=ge.name,ge.content=D[ge.start].data.slice(0,ge.size)):(ge.storage="minifat",ge.size<0?ge.size=0:J!==N&&ge.start!==N&&D[J]&&(ge.content=m(ge,D[J].data,(D[te]||{}).data))),ge.content&&yr(ge.content,0),U[Ee]=ge,K.push(ge)}}function I(C,D){return new Date((br(C,D+4)/1e7*Math.pow(2,32)+br(C,D)/1e7-11644473600)*1e3)}function j(C,D){return u(),c(l.readFileSync(C),D)}function G(C,D){var k=D&&D.type;switch(k||st&&Buffer.isBuffer(C)&&(k="buffer"),k||"base64"){case"file":return j(C,D);case"base64":return c(ea(pi(C)),D);case"binary":return c(ea(C),D)}return c(C,D)}function T(C,D){var k=D||{},M=k.root||"Root Entry";if(C.FullPaths||(C.FullPaths=[]),C.FileIndex||(C.FileIndex=[]),C.FullPaths.length!==C.FileIndex.length)throw new Error("inconsistent CFB structure");C.FullPaths.length===0&&(C.FullPaths[0]=M+"/",C.FileIndex[0]={name:M,type:5}),k.CLSID&&(C.FileIndex[0].clsid=k.CLSID),S(C)}function S(C){var D="Sh33tJ5";if(!pt.find(C,"/"+D)){var k=ne(4);k[0]=55,k[1]=k[3]=50,k[2]=54,C.FileIndex.push({name:D,type:2,content:k,size:4,L:69,R:69,C:69}),C.FullPaths.push(C.FullPaths[0]+D),w(C)}}function w(C,D){T(C);for(var k=!1,M=!1,F=C.FullPaths.length-1;F>=0;--F){var U=C.FileIndex[F];switch(U.type){case 0:M?k=!0:(C.FileIndex.pop(),C.FullPaths.pop());break;case 1:case 2:case 5:M=!0,isNaN(U.R*U.L*U.C)&&(k=!0),U.R>-1&&U.L>-1&&U.R==U.L&&(k=!0);break;default:k=!0;break}}if(!(!k&&!D)){var K=new Date(1987,1,19),te=0,J=Object.create?Object.create(null):{},Y=[];for(F=0;F1?1:-1,se.size=0,se.type=5;else if(fe.slice(-1)=="/"){for(te=F+1;te=Y.length?-1:te,te=F+1;te=Y.length?-1:te,se.type=1}else r(C.FullPaths[F+1]||"")==r(fe)&&(se.R=F+1),se.type=2}}}function A(C,D){var k=D||{};if(k.fileType=="mad")return mn(C,k);switch(w(C),k.fileType){case"zip":return Fu(C,k)}var M=function(Ee){for(var ue=0,ge=0,Le=0;Le0&&(ot<4096?ue+=ot+63>>6:ge+=ot+511>>9)}}for(var At=Ee.FullPaths.length+3>>2,Ua=ue+7>>3,Ds=ue+127>>7,Ti=Ua+ge+At+Ds,fa=Ti+127>>7,$o=fa<=109?0:Math.ceil((fa-109)/127);Ti+fa+$o+127>>7>fa;)$o=++fa<=109?0:Math.ceil((fa-109)/127);var pr=[1,$o,fa,Ds,At,ge,ue,0];return Ee.FileIndex[0].size=ue<<6,pr[7]=(Ee.FileIndex[0].start=pr[0]+pr[1]+pr[2]+pr[3]+pr[4]+pr[5])+(pr[6]+7>>3),pr}(C),F=ne(M[7]<<9),U=0,K=0;{for(U=0;U<8;++U)F.write_shift(1,Pe[U]);for(U=0;U<8;++U)F.write_shift(2,0);for(F.write_shift(2,62),F.write_shift(2,3),F.write_shift(2,65534),F.write_shift(2,9),F.write_shift(2,6),U=0;U<3;++U)F.write_shift(2,0);for(F.write_shift(4,0),F.write_shift(4,M[2]),F.write_shift(4,M[0]+M[1]+M[2]+M[3]-1),F.write_shift(4,0),F.write_shift(4,4096),F.write_shift(4,M[3]?M[0]+M[1]+M[2]-1:N),F.write_shift(4,M[3]),F.write_shift(-4,M[1]?M[0]-1:N),F.write_shift(4,M[1]),U=0;U<109;++U)F.write_shift(-4,U>9)));for(te(M[6]+7>>3);F.l&511;)F.write_shift(-4,Ue.ENDOFCHAIN);for(K=U=0,J=0;J=4096)&&(Q.start=K,te(Y+63>>6)));for(;F.l&511;)F.write_shift(-4,Ue.ENDOFCHAIN);for(U=0;U=4096)if(F.l=Q.start+1<<9,st&&Buffer.isBuffer(Q.content))Q.content.copy(F,F.l,0,Q.size),F.l+=Q.size+511&-512;else{for(J=0;J0&&Q.size<4096)if(st&&Buffer.isBuffer(Q.content))Q.content.copy(F,F.l,0,Q.size),F.l+=Q.size+63&-64;else{for(J=0;J>16|D>>8|D)&255}for(var Se=typeof Uint8Array<"u",me=Se?new Uint8Array(256):[],tt=0;tt<256;++tt)me[tt]=Ae(tt);function Ge(C,D){var k=me[C&255];return D<=8?k>>>8-D:(k=k<<8|me[C>>8&255],D<=16?k>>>16-D:(k=k<<8|me[C>>16&255],k>>>24-D))}function Xt(C,D){var k=D&7,M=D>>>3;return(C[M]|(k<=6?0:C[M+1]<<8))>>>k&3}function Ye(C,D){var k=D&7,M=D>>>3;return(C[M]|(k<=5?0:C[M+1]<<8))>>>k&7}function fr(C,D){var k=D&7,M=D>>>3;return(C[M]|(k<=4?0:C[M+1]<<8))>>>k&15}function Et(C,D){var k=D&7,M=D>>>3;return(C[M]|(k<=3?0:C[M+1]<<8))>>>k&31}function xe(C,D){var k=D&7,M=D>>>3;return(C[M]|(k<=1?0:C[M+1]<<8))>>>k&127}function Zn(C,D,k){var M=D&7,F=D>>>3,U=(1<>>M;return k<8-M||(K|=C[F+1]<<8-M,k<16-M)||(K|=C[F+2]<<16-M,k<24-M)||(K|=C[F+3]<<24-M),K&U}function Mr(C,D,k){var M=D&7,F=D>>>3;return M<=5?C[F]|=(k&7)<>8-M),D+3}function Hr(C,D,k){var M=D&7,F=D>>>3;return k=(k&1)<>>3;return k<<=M,C[F]|=k&255,k>>>=8,C[F+1]=k,D+8}function Ch(C,D,k){var M=D&7,F=D>>>3;return k<<=M,C[F]|=k&255,k>>>=8,C[F+1]=k&255,C[F+2]=k>>>8,D+16}function ks(C,D){var k=C.length,M=2*k>D?2*k:D+5,F=0;if(k>=D)return C;if(st){var U=C2(M);if(C.copy)C.copy(U);else for(;F>M-se,K=(1<=0;--K)D[te|K<0;)J[J.l++]=te[Y++]}return J.l}function K(te,J){for(var Y=0,Q=0,se=Se?new Uint16Array(32768):[];Q0;)J[J.l++]=te[Q++];Y=J.l*8;continue}Y=Mr(J,Y,+(Q+fe==te.length)+2);for(var Ee=0;fe-- >0;){var ue=te[Q];Ee=(Ee<<5^ue)&32767;var ge=-1,Le=0;if((ge=se[Ee])&&(ge|=Q&-32768,ge>Q&&(ge-=32768),ge2){ue=F[Le],ue<=22?Y=Da(J,Y,me[ue+1]>>1)-1:(Da(J,Y,3),Y+=5,Da(J,Y,me[ue-23]>>5),Y+=3);var mt=ue<8?0:ue-4>>2;mt>0&&(Ch(J,Y,Le-re[ue]),Y+=mt),ue=D[Q-ge],Y=Da(J,Y,me[ue]>>3),Y-=3;var ot=ue<4?0:ue-2>>1;ot>0&&(Ch(J,Y,Q-ge-_e[ue]),Y+=ot);for(var At=0;At>8-ue;for(var ge=(1<<7-ue)-1;ge>=0;--ge)Ou[Ee|ge<>>=3){case 16:for(U=3+Xt(C,D),D+=2,Ee=Le[Le.length-1];U-- >0;)Le.push(Ee);break;case 17:for(U=3+Ye(C,D),D+=3;U-- >0;)Le.push(0);break;case 18:for(U=11+xe(C,D),D+=7;U-- >0;)Le.push(0);break;default:Le.push(Ee),J>>0,te=0,J=0;!(M&1);){if(M=Ye(C,k),k+=3,M>>>1)M>>1==1?(te=9,J=5):(k=Hm(C,k),te=Mu,J=Go);else{k&7&&(k+=8-(k&7));var Y=C[k>>>3]|C[(k>>>3)+1]<<8;if(k+=32,Y>0)for(!D&&K0;)F[U++]=C[k>>>3],k+=8;continue}for(;;){!D&&K>>1==1?zt[Q]:Ih[Q];if(k+=se&15,se>>>=4,!(se>>>8&255))F[U++]=se;else{if(se==256)break;se-=257;var fe=se<8?0:se-4>>2;fe>5&&(fe=0);var Ee=U+re[se];fe>0&&(Ee+=Zn(C,k,fe),k+=fe),Q=Zn(C,k,J),se=M>>>1==1?Qt[Q]:xi[Q],k+=se&15,se>>>=4;var ue=se<4?0:se-2>>1,ge=_e[se];for(ue>0&&(ge+=Zn(C,k,ue),k+=ue),!D&&K>>3]:[F.slice(0,U),k+7>>>3]}function Ho(C,D){var k=C.slice(C.l||0),M=Wm(k,D);return C.l+=M[1],M[0]}function Lu(C,D){if(C)typeof console<"u"&&console.error(D);else throw new Error(D)}function Du(C,D){var k=C;yr(k,0);var M=[],F=[],U={FileIndex:M,FullPaths:F};T(U,{root:D.root});for(var K=k.length-4;(k[K]!=80||k[K+1]!=75||k[K+2]!=5||k[K+3]!=6)&&K>=0;)--K;k.l=K+4,k.l+=4;var te=k.read_shift(2);k.l+=6;var J=k.read_shift(4);for(k.l=J,K=0;K0&&(k=k.slice(0,k.length-1),k=k.slice(0,k.lastIndexOf("/")+1),U.slice(0,k.length)!=k););var K=(M[1]||"").match(/boundary="(.*?)"/);if(!K)throw new Error("MAD cannot find boundary");var te="--"+(K[1]||""),J=[],Y=[],Q={FileIndex:J,FullPaths:Y};T(Q);var se,fe=0;for(F=0;F=32&&Ee<128&&++se;var ge=se>=fe*4/5;F.push(M),F.push("Content-Location: "+(k.root||"file:///C:/SheetJS/")+K),F.push("Content-Transfer-Encoding: "+(ge?"quoted-printable":"base64")),F.push("Content-Type: "+Fa(te,K)),F.push(""),F.push(ge?Wo(Q):Ph(Q))}return F.push(M+`--\r `),F.join(`\r `)}function Nh(C){var D={};return T(D,C),D}function Ba(C,D,k,M){var F=M&&M.unsafe;F||T(C);var U=!F&&pt.find(C,D);if(!U){var K=C.FullPaths[0];D.slice(0,K.length)==K?K=D:(K.slice(-1)!="/"&&(K+="/"),K=(K+D).replace("//","/")),U={name:a(D),type:2},C.FileIndex.push(U),C.FullPaths.push(K),F||pt.utils.cfb_gc(C)}return U.content=k,U.size=k?k.length:0,M&&(M.CLSID&&(U.clsid=M.CLSID),M.mt&&(U.mt=M.mt),M.ct&&(U.ct=M.ct)),U}function Ls(C,D){T(C);var k=pt.find(C,D);if(k){for(var M=0;M0?n.setTime(n.getTime()+n.getTimezoneOffset()*60*1e3):e<0&&n.setTime(n.getTime()-n.getTimezoneOffset()*60*1e3),n;if(t instanceof Date)return t;if(KN.getFullYear()==1917&&!isNaN(n.getFullYear())){var r=n.getFullYear();return t.indexOf(""+r)>-1||n.setFullYear(n.getFullYear()+100),n}var a=t.match(/\d+/g)||["2017","2","19","0","0","0"],i=new Date(+a[0],+a[1]-1,+a[2],+a[3]||0,+a[4]||0,+a[5]||0);return t.indexOf("Z")>-1&&(i=new Date(i.getTime()-i.getTimezoneOffset()*60*1e3)),i}function Vm(t,e){if(st&&Buffer.isBuffer(t))return t.toString("binary");if(typeof TextDecoder<"u")try{var n={"€":"€","‚":"‚",ƒ:"ƒ","„":"„","…":"…","†":"†","‡":"‡","ˆ":"ˆ","‰":"‰",Š:"Š","‹":"‹",Œ:"Œ",Ž:"Ž","‘":"‘","’":"’","“":"“","”":"”","•":"•","–":"–","—":"—","˜":"˜","™":"™",š:"š","›":"›",œ:"œ",ž:"ž",Ÿ:"Ÿ"};return Array.isArray(t)&&(t=new Uint8Array(t)),new TextDecoder("latin1").decode(t).replace(/[€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ]/g,function(i){return n[i]||i})}catch{}for(var r=[],a=0;a!=t.length;++a)r.push(String.fromCharCode(t[a]));return r.join("")}function hr(t){if(typeof JSON<"u"&&!Array.isArray(t))return JSON.parse(JSON.stringify(t));if(typeof t!="object"||t==null)return t;if(t instanceof Date)return new Date(t.getTime());var e={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=hr(t[n]));return e}function Dt(t,e){for(var n="";n.length3&&JK.indexOf(s)==-1)return n}else if(s.match(/[a-z]/))return n;return r<0||r>8099?n:(a>0||i>1)&&r!=101?e:t.match(/[^-0-9:,\/\\]/)?n:e}function Ve(t,e,n){if(t.FullPaths){if(typeof n=="string"){var r;return st?r=bi(n):r=_K(n),pt.utils.cfb_add(t,e,r)}pt.utils.cfb_add(t,e,n)}else t.file(e,n)}function yb(){return pt.utils.cfb_new()}var Yt=`\r `,YK={""":'"',"'":"'",">":">","<":"<","&":"&"},Eb=_b(YK),bb=/[&<>'"]/g,XK=/[\u0000-\u0008\u000b-\u001f]/g;function ct(t){var e=t+"";return e.replace(bb,function(n){return Eb[n]}).replace(XK,function(n){return"_x"+("000"+n.charCodeAt(0).toString(16)).slice(-4)+"_"})}function F2(t){return ct(t).replace(/ /g,"_x0020_")}var JN=/[\u0000-\u001f]/g;function QK(t){var e=t+"";return e.replace(bb,function(n){return Eb[n]}).replace(/\n/g,"
").replace(JN,function(n){return"&#x"+("000"+n.charCodeAt(0).toString(16)).slice(-4)+";"})}function ZK(t){var e=t+"";return e.replace(bb,function(n){return Eb[n]}).replace(JN,function(n){return"&#x"+n.charCodeAt(0).toString(16).toUpperCase()+";"})}function eJ(t){return t.replace(/(\r\n|[\r\n])/g," ")}function tJ(t){switch(t){case 1:case!0:case"1":case"true":case"TRUE":return!0;default:return!1}}function lv(t){for(var e="",n=0,r=0,a=0,i=0,s=0,o=0;n191&&r<224){s=(r&31)<<6,s|=a&63,e+=String.fromCharCode(s);continue}if(i=t.charCodeAt(n++),r<240){e+=String.fromCharCode((r&15)<<12|(a&63)<<6|i&63);continue}s=t.charCodeAt(n++),o=((r&7)<<18|(a&63)<<12|(i&63)<<6|s&63)-65536,e+=String.fromCharCode(55296+(o>>>10&1023)),e+=String.fromCharCode(56320+(o&1023))}return e}function B2(t){var e=Io(2*t.length),n,r,a=1,i=0,s=0,o;for(r=0;r>>10&1023),n=56320+(n&1023)),s!==0&&(e[i++]=s&255,e[i++]=s>>>8,s=0),e[i++]=n%256,e[i++]=n>>>8;return e.slice(0,i).toString("ucs2")}function U2(t){return bi(t,"binary").toString("utf8")}var Ef="foo bar baz☃🍣",Gc=st&&(U2(Ef)==lv(Ef)&&U2||B2(Ef)==lv(Ef)&&B2)||lv,Vd=st?function(t){return bi(t,"utf8").toString("binary")}:function(t){for(var e=[],n=0,r=0,a=0;n>6))),e.push(String.fromCharCode(128+(r&63)));break;case(r>=55296&&r<57344):r-=55296,a=t.charCodeAt(n++)-56320+(r<<10),e.push(String.fromCharCode(240+(a>>18&7))),e.push(String.fromCharCode(144+(a>>12&63))),e.push(String.fromCharCode(128+(a>>6&63))),e.push(String.fromCharCode(128+(a&63)));break;default:e.push(String.fromCharCode(224+(r>>12))),e.push(String.fromCharCode(128+(r>>6&63))),e.push(String.fromCharCode(128+(r&63)))}return e.join("")},nJ=function(){var t=[["nbsp"," "],["middot","·"],["quot",'"'],["apos","'"],["gt",">"],["lt","<"],["amp","&"]].map(function(e){return[new RegExp("&"+e[0]+";","ig"),e[1]]});return function(n){for(var r=n.replace(/^[\t\n\r ]+/,"").replace(/[\t\n\r ]+$/,"").replace(/>\s+/g,">").replace(/\s+/g,` `).replace(/<[^>]*>/g,""),a=0;a"+e+""}function jd(t){return Pn(t).map(function(e){return" "+e+'="'+t[e]+'"'}).join("")}function de(t,e,n){return"<"+t+(n!=null?jd(n):"")+(e!=null?(e.match(YN)?' xml:space="preserve"':"")+">"+e+""}function A_(t,e){try{return t.toISOString().replace(/\.\d*/,"")}catch(n){if(e)throw n}return""}function rJ(t,e){switch(typeof t){case"string":var n=de("vt:lpwstr",ct(t));return n=n.replace(/"/g,"_x0022_"),n;case"number":return de((t|0)==t?"vt:i4":"vt:r8",ct(String(t)));case"boolean":return de("vt:bool",t?"true":"false")}if(t instanceof Date)return de("vt:filetime",A_(t));throw new Error("Unable to serialize "+t)}var cn={CORE_PROPS:"http://schemas.openxmlformats.org/package/2006/metadata/core-properties",CUST_PROPS:"http://schemas.openxmlformats.org/officeDocument/2006/custom-properties",EXT_PROPS:"http://schemas.openxmlformats.org/officeDocument/2006/extended-properties",CT:"http://schemas.openxmlformats.org/package/2006/content-types",RELS:"http://schemas.openxmlformats.org/package/2006/relationships",TCMNT:"http://schemas.microsoft.com/office/spreadsheetml/2018/threadedcomments",dc:"http://purl.org/dc/elements/1.1/",dcterms:"http://purl.org/dc/terms/",dcmitype:"http://purl.org/dc/dcmitype/",mx:"http://schemas.microsoft.com/office/mac/excel/2008/main",r:"http://schemas.openxmlformats.org/officeDocument/2006/relationships",sjs:"http://schemas.openxmlformats.org/package/2006/sheetjs/core-properties",vt:"http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes",xsi:"http://www.w3.org/2001/XMLSchema-instance",xsd:"http://www.w3.org/2001/XMLSchema"},Iu=["http://schemas.openxmlformats.org/spreadsheetml/2006/main","http://purl.oclc.org/ooxml/spreadsheetml/main","http://schemas.microsoft.com/office/excel/2006/main","http://schemas.microsoft.com/office/excel/2006/2"],Er={o:"urn:schemas-microsoft-com:office:office",x:"urn:schemas-microsoft-com:office:excel",ss:"urn:schemas-microsoft-com:office:spreadsheet",dt:"uuid:C2F41010-65B3-11d1-A29F-00AA00C14882",mv:"http://macVmlSchemaUri",v:"urn:schemas-microsoft-com:vml",html:"http://www.w3.org/TR/REC-html40"};function aJ(t,e){for(var n=1-2*(t[e+7]>>>7),r=((t[e+7]&127)<<4)+(t[e+6]>>>4&15),a=t[e+6]&15,i=5;i>=0;--i)a=a*256+t[e+i];return r==2047?a==0?n*(1/0):NaN:(r==0?r=-1022:(r-=1023,a+=Math.pow(2,52)),n*Math.pow(2,r-52)*a)}function iJ(t,e,n){var r=(e<0||1/e==-1/0?1:0)<<7,a=0,i=0,s=r?-e:e;isFinite(s)?s==0?a=i=0:(a=Math.floor(Math.log(s)/Math.LN2),i=s*Math.pow(2,52-a),a<=-1023&&(!isFinite(i)||i>4|r}var V2=function(t){for(var e=[],n=10240,r=0;r0&&Buffer.isBuffer(t[0][0])?Buffer.concat(t[0].map(function(e){return Buffer.isBuffer(e)?e:bi(e)})):V2(t)}:V2,z2=function(t,e,n){for(var r=[],a=e;a0?xh(t,e+4,e+4+n-1):""},ZN=QN,eO=function(t,e){var n=br(t,e);return n>0?xh(t,e+4,e+4+n-1):""},tO=eO,nO=function(t,e){var n=2*br(t,e);return n>0?xh(t,e+4,e+4+n-1):""},rO=nO,aO=function(e,n){var r=br(e,n);return r>0?xb(e,n+4,n+4+r):""},iO=aO,sO=function(t,e){var n=br(t,e);return n>0?xh(t,e+4,e+4+n):""},oO=sO,lO=function(t,e){return aJ(t,e)},f0=lO,Sb=function(e){return Array.isArray(e)||typeof Uint8Array<"u"&&e instanceof Uint8Array};st&&(ZN=function(e,n){if(!Buffer.isBuffer(e))return QN(e,n);var r=e.readUInt32LE(n);return r>0?e.toString("utf8",n+4,n+4+r-1):""},tO=function(e,n){if(!Buffer.isBuffer(e))return eO(e,n);var r=e.readUInt32LE(n);return r>0?e.toString("utf8",n+4,n+4+r-1):""},rO=function(e,n){if(!Buffer.isBuffer(e))return nO(e,n);var r=2*e.readUInt32LE(n);return e.toString("utf16le",n+4,n+4+r-1)},iO=function(e,n){if(!Buffer.isBuffer(e))return aO(e,n);var r=e.readUInt32LE(n);return e.toString("utf16le",n+4,n+4+r)},oO=function(e,n){if(!Buffer.isBuffer(e))return sO(e,n);var r=e.readUInt32LE(n);return e.toString("utf8",n+4,n+4+r)},f0=function(e,n){return Buffer.isBuffer(e)?e.readDoubleLE(n):lO(e,n)},Sb=function(e){return Buffer.isBuffer(e)||Array.isArray(e)||typeof Uint8Array<"u"&&e instanceof Uint8Array});var il=function(t,e){return t[e]},Ec=function(t,e){return t[e+1]*256+t[e]},sJ=function(t,e){var n=t[e+1]*256+t[e];return n<32768?n:(65535-n+1)*-1},br=function(t,e){return t[e+3]*(1<<24)+(t[e+2]<<16)+(t[e+1]<<8)+t[e]},Ws=function(t,e){return t[e+3]<<24|t[e+2]<<16|t[e+1]<<8|t[e]},oJ=function(t,e){return t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3]};function Hc(t,e){var n="",r,a,i=[],s,o,l,u;switch(e){case"dbcs":if(u=this.l,st&&Buffer.isBuffer(this))n=this.slice(this.l,this.l+2*t).toString("utf16le");else for(l=0;l0?Ws:oJ)(this,this.l),this.l+=4,r):(a=br(this,this.l),this.l+=4,a);case 8:case-8:if(e==="f")return t==8?a=f0(this,this.l):a=f0([this[this.l+7],this[this.l+6],this[this.l+5],this[this.l+4],this[this.l+3],this[this.l+2],this[this.l+1],this[this.l+0]],0),this.l+=8,a;t=8;case 16:n=XN(this,this.l,t);break}}return this.l+=t,n}var lJ=function(t,e,n){t[n]=e&255,t[n+1]=e>>>8&255,t[n+2]=e>>>16&255,t[n+3]=e>>>24&255},uJ=function(t,e,n){t[n]=e&255,t[n+1]=e>>8&255,t[n+2]=e>>16&255,t[n+3]=e>>24&255},cJ=function(t,e,n){t[n]=e&255,t[n+1]=e>>>8&255};function dJ(t,e,n){var r=0,a=0;if(n==="dbcs"){for(a=0;a!=e.length;++a)cJ(this,e.charCodeAt(a),this.l+2*a);r=2*e.length}else if(n==="sbcs"){for(e=e.replace(/[^\x00-\x7F]/g,"_"),a=0;a!=e.length;++a)this[this.l+a]=e.charCodeAt(a)&255;r=e.length}else if(n==="hex"){for(;a>8}for(;this.l>>=8,this[this.l+1]=e&255;break;case 3:r=3,this[this.l]=e&255,e>>>=8,this[this.l+1]=e&255,e>>>=8,this[this.l+2]=e&255;break;case 4:r=4,lJ(this,e,this.l);break;case 8:if(r=8,n==="f"){iJ(this,e,this.l);break}case 16:break;case-4:r=4,uJ(this,e,this.l);break}return this.l+=r,this}function uO(t,e){var n=XN(this,this.l,t.length>>1);if(n!==t)throw new Error(e+"Expected "+t+" saw "+n);this.l+=t.length>>1}function yr(t,e){t.l=e,t.read_shift=Hc,t.chk=uO,t.write_shift=dJ}function Ma(t,e){t.l+=e}function ne(t){var e=Io(t);return yr(e,0),e}function ur(){var t=[],e=st?256:2048,n=function(u){var c=ne(u);return yr(c,0),c},r=n(e),a=function(){r&&(r.length>r.l&&(r=r.slice(0,r.l),r.l=r.length),r.length>0&&t.push(r),r=null)},i=function(u){return r&&u=128?1:0)+1,r>=128&&++i,r>=16384&&++i,r>=2097152&&++i;var s=t.next(i);a<=127?s.write_shift(1,a):(s.write_shift(1,(a&127)+128),s.write_shift(1,a>>7));for(var o=0;o!=4;++o)if(r>=128)s.write_shift(1,(r&127)+128),r>>=7;else{s.write_shift(1,r);break}r>0&&Sb(n)&&t.push(n)}}function Wc(t,e,n){var r=hr(t);if(e.s?(r.cRel&&(r.c+=e.s.c),r.rRel&&(r.r+=e.s.r)):(r.cRel&&(r.c+=e.c),r.rRel&&(r.r+=e.r)),!n||n.biff<12){for(;r.c>=256;)r.c-=256;for(;r.r>=65536;)r.r-=65536}return r}function H2(t,e,n){var r=hr(t);return r.s=Wc(r.s,e.s,n),r.e=Wc(r.e,e.s,n),r}function $c(t,e){if(t.cRel&&t.c<0)for(t=hr(t);t.c<0;)t.c+=e>8?16384:256;if(t.rRel&&t.r<0)for(t=hr(t);t.r<0;)t.r+=e>8?1048576:e>5?65536:16384;var n=ht(t);return!t.cRel&&t.cRel!=null&&(n=pJ(n)),!t.rRel&&t.rRel!=null&&(n=hJ(n)),n}function uv(t,e){return t.s.r==0&&!t.s.rRel&&t.e.r==(e.biff>=12?1048575:e.biff>=8?65536:16384)&&!t.e.rRel?(t.s.cRel?"":"$")+Un(t.s.c)+":"+(t.e.cRel?"":"$")+Un(t.e.c):t.s.c==0&&!t.s.cRel&&t.e.c==(e.biff>=12?16383:255)&&!t.e.cRel?(t.s.rRel?"":"$")+Cn(t.s.r)+":"+(t.e.rRel?"":"$")+Cn(t.e.r):$c(t.s,e.biff)+":"+$c(t.e,e.biff)}function Tb(t){return parseInt(fJ(t),10)-1}function Cn(t){return""+(t+1)}function hJ(t){return t.replace(/([A-Z]|^)(\d+)$/,"$1$$$2")}function fJ(t){return t.replace(/\$(\d+)$/,"$1")}function wb(t){for(var e=mJ(t),n=0,r=0;r!==e.length;++r)n=26*n+e.charCodeAt(r)-64;return n-1}function Un(t){if(t<0)throw new Error("invalid column "+t);var e="";for(++t;t;t=Math.floor((t-1)/26))e=String.fromCharCode((t-1)%26+65)+e;return e}function pJ(t){return t.replace(/^([A-Z])/,"$$$1")}function mJ(t){return t.replace(/^\$([A-Z])/,"$1")}function gJ(t){return t.replace(/(\$?[A-Z]*)(\$?\d*)/,"$1,$2").split(",")}function dn(t){for(var e=0,n=0,r=0;r=48&&a<=57?e=10*e+(a-48):a>=65&&a<=90&&(n=26*n+(a-64))}return{c:n-1,r:e-1}}function ht(t){for(var e=t.c+1,n="";e;e=(e-1)/26|0)n=String.fromCharCode((e-1)%26+65)+n;return n+(t.r+1)}function Rr(t){var e=t.indexOf(":");return e==-1?{s:dn(t),e:dn(t)}:{s:dn(t.slice(0,e)),e:dn(t.slice(e+1))}}function Kt(t,e){return typeof e>"u"||typeof e=="number"?Kt(t.s,t.e):(typeof t!="string"&&(t=ht(t)),typeof e!="string"&&(e=ht(e)),t==e?t:t+":"+e)}function Ct(t){var e={s:{c:0,r:0},e:{c:0,r:0}},n=0,r=0,a=0,i=t.length;for(n=0;r26);++r)n=26*n+a;for(e.s.c=--n,n=0;r9);++r)n=10*n+a;if(e.s.r=--n,r===i||a!=10)return e.e.c=e.s.c,e.e.r=e.s.r,e;for(++r,n=0;r!=i&&!((a=t.charCodeAt(r)-64)<1||a>26);++r)n=26*n+a;for(e.e.c=--n,n=0;r!=i&&!((a=t.charCodeAt(r)-48)<0||a>9);++r)n=10*n+a;return e.e.r=--n,e}function W2(t,e){var n=t.t=="d"&&e instanceof Date;if(t.z!=null)try{return t.w=xs(t.z,n?dr(e):e)}catch{}try{return t.w=xs((t.XF||{}).numFmtId||(n?14:0),n?dr(e):e)}catch{return""+e}}function mi(t,e,n){return t==null||t.t==null||t.t=="z"?"":t.w!==void 0?t.w:(t.t=="d"&&!t.z&&n&&n.dateNF&&(t.z=n.dateNF),t.t=="e"?Sh[t.v]||t.v:e==null?W2(t,t.v):W2(t,e))}function Uo(t,e){var n=e&&e.sheet?e.sheet:"Sheet1",r={};return r[n]=t,{SheetNames:[n],Sheets:r}}function cO(t,e,n){var r=n||{},a=t?Array.isArray(t):r.dense,i=t||(a?[]:{}),s=0,o=0;if(i&&r.origin!=null){if(typeof r.origin=="number")s=r.origin;else{var l=typeof r.origin=="string"?dn(r.origin):r.origin;s=l.r,o=l.c}i["!ref"]||(i["!ref"]="A1:A1")}var u={s:{c:1e7,r:1e7},e:{c:0,r:0}};if(i["!ref"]){var c=Ct(i["!ref"]);u.s.c=c.s.c,u.s.r=c.s.r,u.e.c=Math.max(u.e.c,c.e.c),u.e.r=Math.max(u.e.r,c.e.r),s==-1&&(u.e.r=s=c.e.r+1)}for(var h=0;h!=e.length;++h)if(e[h]){if(!Array.isArray(e[h]))throw new Error("aoa_to_sheet expects an array of arrays");for(var f=0;f!=e[h].length;++f)if(!(typeof e[h][f]>"u")){var p={v:e[h][f]},g=s+h,m=o+f;if(u.s.r>g&&(u.s.r=g),u.s.c>m&&(u.s.c=m),u.e.r0&&e.write_shift(0,t,"dbcs"),n?e.slice(0,e.l):e}function _J(t){return{ich:t.read_shift(2),ifnt:t.read_shift(2)}}function yJ(t,e){return e||(e=ne(4)),e.write_shift(2,0),e.write_shift(2,0),e}function Cb(t,e){var n=t.l,r=t.read_shift(1),a=Vn(t),i=[],s={t:a,h:a};if(r&1){for(var o=t.read_shift(4),l=0;l!=o;++l)i.push(_J(t));s.r=i}else s.r=[{ich:0,ifnt:0}];return t.l=n+e,s}function EJ(t,e){var n=!1;return e==null&&(n=!0,e=ne(15+4*t.t.length)),e.write_shift(1,0),hn(t.t,e),n?e.slice(0,e.l):e}var bJ=Cb;function xJ(t,e){var n=!1;return e==null&&(n=!0,e=ne(23+4*t.t.length)),e.write_shift(1,1),hn(t.t,e),e.write_shift(4,1),yJ({ich:0,ifnt:0},e),n?e.slice(0,e.l):e}function Gr(t){var e=t.read_shift(4),n=t.read_shift(2);return n+=t.read_shift(1)<<16,t.l++,{c:e,iStyleRef:n}}function Vo(t,e){return e==null&&(e=ne(8)),e.write_shift(-4,t.c),e.write_shift(3,t.iStyleRef||t.s),e.write_shift(1,0),e}function jo(t){var e=t.read_shift(2);return e+=t.read_shift(1)<<16,t.l++,{c:-1,iStyleRef:e}}function zo(t,e){return e==null&&(e=ne(4)),e.write_shift(3,t.iStyleRef||t.s),e.write_shift(1,0),e}var SJ=Vn,dO=hn;function Ab(t){var e=t.read_shift(4);return e===0||e===4294967295?"":t.read_shift(e,"dbcs")}function p0(t,e){var n=!1;return e==null&&(n=!0,e=ne(127)),e.write_shift(4,t.length>0?t.length:4294967295),t.length>0&&e.write_shift(0,t,"dbcs"),n?e.slice(0,e.l):e}var TJ=Vn,I_=Ab,Ib=p0;function hO(t){var e=t.slice(t.l,t.l+4),n=e[0]&1,r=e[0]&2;t.l+=4;var a=r===0?f0([0,0,0,0,e[0]&252,e[1],e[2],e[3]],0):Ws(e,0)>>2;return n?a/100:a}function fO(t,e){e==null&&(e=ne(4));var n=0,r=0,a=t*100;if(t==(t|0)&&t>=-(1<<29)&&t<1<<29?r=1:a==(a|0)&&a>=-(1<<29)&&a<1<<29&&(r=1,n=1),r)e.write_shift(-4,((n?a:t)<<2)+(n+2));else throw new Error("unsupported RkNumber "+t)}function pO(t){var e={s:{},e:{}};return e.s.r=t.read_shift(4),e.e.r=t.read_shift(4),e.s.c=t.read_shift(4),e.e.c=t.read_shift(4),e}function wJ(t,e){return e||(e=ne(16)),e.write_shift(4,t.s.r),e.write_shift(4,t.e.r),e.write_shift(4,t.s.c),e.write_shift(4,t.e.c),e}var qo=pO,Ru=wJ;function ku(t){if(t.length-t.l<8)throw"XLS Xnum Buffer underflow";return t.read_shift(8,"f")}function Po(t,e){return(e||ne(8)).write_shift(8,t,"f")}function CJ(t){var e={},n=t.read_shift(1),r=n>>>1,a=t.read_shift(1),i=t.read_shift(2,"i"),s=t.read_shift(1),o=t.read_shift(1),l=t.read_shift(1);switch(t.l++,r){case 0:e.auto=1;break;case 1:e.index=a;var u=LJ[a];u&&(e.rgb=rC(u));break;case 2:e.rgb=rC([s,o,l]);break;case 3:e.theme=a;break}return i!=0&&(e.tint=i>0?i/32767:i/32768),e}function m0(t,e){if(e||(e=ne(8)),!t||t.auto)return e.write_shift(4,0),e.write_shift(4,0),e;t.index!=null?(e.write_shift(1,2),e.write_shift(1,t.index)):t.theme!=null?(e.write_shift(1,6),e.write_shift(1,t.theme)):(e.write_shift(1,5),e.write_shift(1,0));var n=t.tint||0;if(n>0?n*=32767:n<0&&(n*=32768),e.write_shift(2,n),!t.rgb||t.theme!=null)e.write_shift(2,0),e.write_shift(1,0),e.write_shift(1,0);else{var r=t.rgb||"FFFFFF";typeof r=="number"&&(r=("000000"+r.toString(16)).slice(-6)),e.write_shift(1,parseInt(r.slice(0,2),16)),e.write_shift(1,parseInt(r.slice(2,4),16)),e.write_shift(1,parseInt(r.slice(4,6),16)),e.write_shift(1,255)}return e}function AJ(t){var e=t.read_shift(1);t.l++;var n={fBold:e&1,fItalic:e&2,fUnderline:e&4,fStrikeout:e&8,fOutline:e&16,fShadow:e&32,fCondense:e&64,fExtend:e&128};return n}function IJ(t,e){e||(e=ne(2));var n=(t.italic?2:0)|(t.strike?8:0)|(t.outline?16:0)|(t.shadow?32:0)|(t.condense?64:0)|(t.extend?128:0);return e.write_shift(1,n),e.write_shift(1,0),e}var mO=2,gr=3,bf=11,g0=19,xf=64,PJ=65,RJ=71,kJ=4108,NJ=4126,En=80,$2={1:{n:"CodePage",t:mO},2:{n:"Category",t:En},3:{n:"PresentationFormat",t:En},4:{n:"ByteCount",t:gr},5:{n:"LineCount",t:gr},6:{n:"ParagraphCount",t:gr},7:{n:"SlideCount",t:gr},8:{n:"NoteCount",t:gr},9:{n:"HiddenCount",t:gr},10:{n:"MultimediaClipCount",t:gr},11:{n:"ScaleCrop",t:bf},12:{n:"HeadingPairs",t:kJ},13:{n:"TitlesOfParts",t:NJ},14:{n:"Manager",t:En},15:{n:"Company",t:En},16:{n:"LinksUpToDate",t:bf},17:{n:"CharacterCount",t:gr},19:{n:"SharedDoc",t:bf},22:{n:"HyperlinksChanged",t:bf},23:{n:"AppVersion",t:gr,p:"version"},24:{n:"DigSig",t:PJ},26:{n:"ContentType",t:En},27:{n:"ContentStatus",t:En},28:{n:"Language",t:En},29:{n:"Version",t:En},255:{},2147483648:{n:"Locale",t:g0},2147483651:{n:"Behavior",t:g0},1919054434:{}},K2={1:{n:"CodePage",t:mO},2:{n:"Title",t:En},3:{n:"Subject",t:En},4:{n:"Author",t:En},5:{n:"Keywords",t:En},6:{n:"Comments",t:En},7:{n:"Template",t:En},8:{n:"LastAuthor",t:En},9:{n:"RevNumber",t:En},10:{n:"EditTime",t:xf},11:{n:"LastPrinted",t:xf},12:{n:"CreatedDate",t:xf},13:{n:"ModifiedDate",t:xf},14:{n:"PageCount",t:gr},15:{n:"WordCount",t:gr},16:{n:"CharCount",t:gr},17:{n:"Thumbnail",t:RJ},18:{n:"Application",t:En},19:{n:"DocSecurity",t:gr},255:{},2147483648:{n:"Locale",t:g0},2147483651:{n:"Behavior",t:g0},1919054434:{}};function OJ(t){return t.map(function(e){return[e>>16&255,e>>8&255,e&255]})}var MJ=OJ([0,16777215,16711680,65280,255,16776960,16711935,65535,0,16777215,16711680,65280,255,16776960,16711935,65535,8388608,32768,128,8421376,8388736,32896,12632256,8421504,10066431,10040166,16777164,13434879,6684774,16744576,26316,13421823,128,16711935,16776960,65535,8388736,8388608,32896,255,52479,13434879,13434828,16777113,10079487,16751052,13408767,16764057,3368703,3394764,10079232,16763904,16750848,16737792,6710937,9868950,13158,3381606,13056,3355392,10040064,10040166,3355545,3355443,16777215,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),LJ=hr(MJ),Sh={0:"#NULL!",7:"#DIV/0!",15:"#VALUE!",23:"#REF!",29:"#NAME?",36:"#NUM!",42:"#N/A",43:"#GETTING_DATA",255:"#WTF?"},DJ={"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml":"workbooks","application/vnd.ms-excel.sheet.macroEnabled.main+xml":"workbooks","application/vnd.ms-excel.sheet.binary.macroEnabled.main":"workbooks","application/vnd.ms-excel.addin.macroEnabled.main+xml":"workbooks","application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml":"workbooks","application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml":"sheets","application/vnd.ms-excel.worksheet":"sheets","application/vnd.ms-excel.binIndexWs":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml":"charts","application/vnd.ms-excel.chartsheet":"charts","application/vnd.ms-excel.macrosheet+xml":"macros","application/vnd.ms-excel.macrosheet":"macros","application/vnd.ms-excel.intlmacrosheet":"TODO","application/vnd.ms-excel.binIndexMs":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml":"dialogs","application/vnd.ms-excel.dialogsheet":"dialogs","application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml":"strs","application/vnd.ms-excel.sharedStrings":"strs","application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml":"styles","application/vnd.ms-excel.styles":"styles","application/vnd.openxmlformats-package.core-properties+xml":"coreprops","application/vnd.openxmlformats-officedocument.custom-properties+xml":"custprops","application/vnd.openxmlformats-officedocument.extended-properties+xml":"extprops","application/vnd.openxmlformats-officedocument.customXmlProperties+xml":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.customProperty":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml":"comments","application/vnd.ms-excel.comments":"comments","application/vnd.ms-excel.threadedcomments+xml":"threadedcomments","application/vnd.ms-excel.person+xml":"people","application/vnd.openxmlformats-officedocument.spreadsheetml.sheetMetadata+xml":"metadata","application/vnd.ms-excel.sheetMetadata":"metadata","application/vnd.ms-excel.pivotTable":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.pivotTable+xml":"TODO","application/vnd.openxmlformats-officedocument.drawingml.chart+xml":"TODO","application/vnd.ms-office.chartcolorstyle+xml":"TODO","application/vnd.ms-office.chartstyle+xml":"TODO","application/vnd.ms-office.chartex+xml":"TODO","application/vnd.ms-excel.calcChain":"calcchains","application/vnd.openxmlformats-officedocument.spreadsheetml.calcChain+xml":"calcchains","application/vnd.openxmlformats-officedocument.spreadsheetml.printerSettings":"TODO","application/vnd.ms-office.activeX":"TODO","application/vnd.ms-office.activeX+xml":"TODO","application/vnd.ms-excel.attachedToolbars":"TODO","application/vnd.ms-excel.connections":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml":"TODO","application/vnd.ms-excel.externalLink":"links","application/vnd.openxmlformats-officedocument.spreadsheetml.externalLink+xml":"links","application/vnd.ms-excel.pivotCacheDefinition":"TODO","application/vnd.ms-excel.pivotCacheRecords":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.pivotCacheDefinition+xml":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.pivotCacheRecords+xml":"TODO","application/vnd.ms-excel.queryTable":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.queryTable+xml":"TODO","application/vnd.ms-excel.userNames":"TODO","application/vnd.ms-excel.revisionHeaders":"TODO","application/vnd.ms-excel.revisionLog":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.revisionHeaders+xml":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.revisionLog+xml":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.userNames+xml":"TODO","application/vnd.ms-excel.tableSingleCells":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.tableSingleCells+xml":"TODO","application/vnd.ms-excel.slicer":"TODO","application/vnd.ms-excel.slicerCache":"TODO","application/vnd.ms-excel.slicer+xml":"TODO","application/vnd.ms-excel.slicerCache+xml":"TODO","application/vnd.ms-excel.wsSortMap":"TODO","application/vnd.ms-excel.table":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml":"TODO","application/vnd.openxmlformats-officedocument.theme+xml":"themes","application/vnd.openxmlformats-officedocument.themeOverride+xml":"TODO","application/vnd.ms-excel.Timeline+xml":"TODO","application/vnd.ms-excel.TimelineCache+xml":"TODO","application/vnd.ms-office.vbaProject":"vba","application/vnd.ms-office.vbaProjectSignature":"TODO","application/vnd.ms-office.volatileDependencies":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.volatileDependencies+xml":"TODO","application/vnd.ms-excel.controlproperties+xml":"TODO","application/vnd.openxmlformats-officedocument.model+data":"TODO","application/vnd.ms-excel.Survey+xml":"TODO","application/vnd.openxmlformats-officedocument.drawing+xml":"drawings","application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml":"TODO","application/vnd.openxmlformats-officedocument.drawingml.diagramColors+xml":"TODO","application/vnd.openxmlformats-officedocument.drawingml.diagramData+xml":"TODO","application/vnd.openxmlformats-officedocument.drawingml.diagramLayout+xml":"TODO","application/vnd.openxmlformats-officedocument.drawingml.diagramStyle+xml":"TODO","application/vnd.openxmlformats-officedocument.vmlDrawing":"TODO","application/vnd.openxmlformats-package.relationships+xml":"rels","application/vnd.openxmlformats-officedocument.oleObject":"TODO","image/png":"TODO",sheet:"js"},Sf={workbooks:{xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml",xlsm:"application/vnd.ms-excel.sheet.macroEnabled.main+xml",xlsb:"application/vnd.ms-excel.sheet.binary.macroEnabled.main",xlam:"application/vnd.ms-excel.addin.macroEnabled.main+xml",xltx:"application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml"},strs:{xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml",xlsb:"application/vnd.ms-excel.sharedStrings"},comments:{xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml",xlsb:"application/vnd.ms-excel.comments"},sheets:{xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml",xlsb:"application/vnd.ms-excel.worksheet"},charts:{xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml",xlsb:"application/vnd.ms-excel.chartsheet"},dialogs:{xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml",xlsb:"application/vnd.ms-excel.dialogsheet"},macros:{xlsx:"application/vnd.ms-excel.macrosheet+xml",xlsb:"application/vnd.ms-excel.macrosheet"},metadata:{xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheetMetadata+xml",xlsb:"application/vnd.ms-excel.sheetMetadata"},styles:{xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml",xlsb:"application/vnd.ms-excel.styles"}};function gO(){return{workbooks:[],sheets:[],charts:[],dialogs:[],macros:[],rels:[],strs:[],comments:[],threadedcomments:[],links:[],coreprops:[],extprops:[],custprops:[],themes:[],styles:[],calcchains:[],vba:[],drawings:[],metadata:[],people:[],TODO:[],xmlns:""}}function vO(t,e){var n=WK(DJ),r=[],a;r[r.length]=Yt,r[r.length]=de("Types",null,{xmlns:cn.CT,"xmlns:xsd":cn.xsd,"xmlns:xsi":cn.xsi}),r=r.concat([["xml","application/xml"],["bin","application/vnd.ms-excel.sheet.binary.macroEnabled.main"],["vml","application/vnd.openxmlformats-officedocument.vmlDrawing"],["data","application/vnd.openxmlformats-officedocument.model+data"],["bmp","image/bmp"],["png","image/png"],["gif","image/gif"],["emf","image/x-emf"],["wmf","image/x-wmf"],["jpg","image/jpeg"],["jpeg","image/jpeg"],["tif","image/tiff"],["tiff","image/tiff"],["pdf","application/pdf"],["rels","application/vnd.openxmlformats-package.relationships+xml"]].map(function(l){return de("Default",null,{Extension:l[0],ContentType:l[1]})}));var i=function(l){t[l]&&t[l].length>0&&(a=t[l][0],r[r.length]=de("Override",null,{PartName:(a[0]=="/"?"":"/")+a,ContentType:Sf[l][e.bookType]||Sf[l].xlsx}))},s=function(l){(t[l]||[]).forEach(function(u){r[r.length]=de("Override",null,{PartName:(u[0]=="/"?"":"/")+u,ContentType:Sf[l][e.bookType]||Sf[l].xlsx})})},o=function(l){(t[l]||[]).forEach(function(u){r[r.length]=de("Override",null,{PartName:(u[0]=="/"?"":"/")+u,ContentType:n[l][0]})})};return i("workbooks"),s("sheets"),s("charts"),o("themes"),["strs","styles"].forEach(i),["coreprops","extprops","custprops"].forEach(o),o("vba"),o("comments"),o("threadedcomments"),o("drawings"),s("metadata"),o("people"),r.length>2&&(r[r.length]="",r[1]=r[1].replace("/>",">")),r.join("")}var rt={WB:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument",SHEET:"http://sheetjs.openxmlformats.org/officeDocument/2006/relationships/officeDocument",HLINK:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink",VML:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/vmlDrawing",XPATH:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/externalLinkPath",XMISS:"http://schemas.microsoft.com/office/2006/relationships/xlExternalLinkPath/xlPathMissing",XLINK:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/externalLink",CXML:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXml",CXMLP:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXmlProps",CMNT:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments",CORE_PROPS:"http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties",EXT_PROPS:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties",CUST_PROPS:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/custom-properties",SST:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings",STY:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles",THEME:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme",CHART:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart",CHARTEX:"http://schemas.microsoft.com/office/2014/relationships/chartEx",CS:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/chartsheet",WS:["http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet","http://purl.oclc.org/ooxml/officeDocument/relationships/worksheet"],DS:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/dialogsheet",MS:"http://schemas.microsoft.com/office/2006/relationships/xlMacrosheet",IMG:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",DRAW:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing",XLMETA:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/sheetMetadata",TCMNT:"http://schemas.microsoft.com/office/2017/10/relationships/threadedComment",PEOPLE:"http://schemas.microsoft.com/office/2017/10/relationships/person",VBA:"http://schemas.microsoft.com/office/2006/relationships/vbaProject"};function _O(t){var e=t.lastIndexOf("/");return t.slice(0,e+1)+"_rels/"+t.slice(e+1)+".rels"}function Bl(t){var e=[Yt,de("Relationships",null,{xmlns:cn.RELS})];return Pn(t["!id"]).forEach(function(n){e[e.length]=de("Relationship",null,t["!id"][n])}),e.length>2&&(e[e.length]="",e[1]=e[1].replace("/>",">")),e.join("")}function ut(t,e,n,r,a,i){if(a||(a={}),t["!id"]||(t["!id"]={}),t["!idx"]||(t["!idx"]=1),e<0)for(e=t["!idx"];t["!id"]["rId"+e];++e);if(t["!idx"]=e+1,a.Id="rId"+e,a.Type=r,a.Target=n,[rt.HLINK,rt.XPATH,rt.XMISS].indexOf(a.Type)>-1&&(a.TargetMode="External"),t["!id"][a.Id])throw new Error("Cannot rewrite rId "+e);return t["!id"][a.Id]=a,t[("/"+a.Target).replace("//","/")]=a,e}function FJ(t){var e=[Yt];e.push(` `),e.push(` `);for(var n=0;n `);return e.push(""),e.join("")}function J2(t,e,n){return[' `,' `,` `].join("")}function BJ(t,e){return[' `,' `,` `].join("")}function UJ(t){var e=[Yt];e.push(` `);for(var n=0;n!=t.length;++n)e.push(J2(t[n][0],t[n][1])),e.push(BJ("",t[n][0]));return e.push(J2("","Document","pkg")),e.push(""),e.join("")}function yO(){return'SheetJS '+l0.version+""}var co=[["cp:category","Category"],["cp:contentStatus","ContentStatus"],["cp:keywords","Keywords"],["cp:lastModifiedBy","LastAuthor"],["cp:lastPrinted","LastPrinted"],["cp:revision","RevNumber"],["cp:version","Version"],["dc:creator","Author"],["dc:description","Comments"],["dc:identifier","Identifier"],["dc:language","Language"],["dc:subject","Subject"],["dc:title","Title"],["dcterms:created","CreatedDate","date"],["dcterms:modified","ModifiedDate","date"]];function cv(t,e,n,r,a){a[t]!=null||e==null||e===""||(a[t]=e,e=ct(e),r[r.length]=n?de(t,e,n):Sn(t,e))}function EO(t,e){var n=e||{},r=[Yt,de("cp:coreProperties",null,{"xmlns:cp":cn.CORE_PROPS,"xmlns:dc":cn.dc,"xmlns:dcterms":cn.dcterms,"xmlns:dcmitype":cn.dcmitype,"xmlns:xsi":cn.xsi})],a={};if(!t&&!n.Props)return r.join("");t&&(t.CreatedDate!=null&&cv("dcterms:created",typeof t.CreatedDate=="string"?t.CreatedDate:A_(t.CreatedDate,n.WTF),{"xsi:type":"dcterms:W3CDTF"},r,a),t.ModifiedDate!=null&&cv("dcterms:modified",typeof t.ModifiedDate=="string"?t.ModifiedDate:A_(t.ModifiedDate,n.WTF),{"xsi:type":"dcterms:W3CDTF"},r,a));for(var i=0;i!=co.length;++i){var s=co[i],o=n.Props&&n.Props[s[1]]!=null?n.Props[s[1]]:t?t[s[1]]:null;o===!0?o="1":o===!1?o="0":typeof o=="number"&&(o=String(o)),o!=null&&cv(s[0],o,null,r,a)}return r.length>2&&(r[r.length]="",r[1]=r[1].replace("/>",">")),r.join("")}var Ul=[["Application","Application","string"],["AppVersion","AppVersion","string"],["Company","Company","string"],["DocSecurity","DocSecurity","string"],["Manager","Manager","string"],["HyperlinksChanged","HyperlinksChanged","bool"],["SharedDoc","SharedDoc","bool"],["LinksUpToDate","LinksUpToDate","bool"],["ScaleCrop","ScaleCrop","bool"],["HeadingPairs","HeadingPairs","raw"],["TitlesOfParts","TitlesOfParts","raw"]],bO=["Worksheets","SheetNames","NamedRanges","DefinedNames","Chartsheets","ChartNames"];function xO(t){var e=[],n=de;return t||(t={}),t.Application="SheetJS",e[e.length]=Yt,e[e.length]=de("Properties",null,{xmlns:cn.EXT_PROPS,"xmlns:vt":cn.vt}),Ul.forEach(function(r){if(t[r[1]]!==void 0){var a;switch(r[2]){case"string":a=ct(String(t[r[1]]));break;case"bool":a=t[r[1]]?"true":"false";break}a!==void 0&&(e[e.length]=n(r[0],a))}}),e[e.length]=n("HeadingPairs",n("vt:vector",n("vt:variant","Worksheets")+n("vt:variant",n("vt:i4",String(t.Worksheets))),{size:2,baseType:"variant"})),e[e.length]=n("TitlesOfParts",n("vt:vector",t.SheetNames.map(function(r){return""+ct(r)+""}).join(""),{size:t.Worksheets,baseType:"lpstr"})),e.length>2&&(e[e.length]="",e[1]=e[1].replace("/>",">")),e.join("")}function SO(t){var e=[Yt,de("Properties",null,{xmlns:cn.CUST_PROPS,"xmlns:vt":cn.vt})];if(!t)return e.join("");var n=1;return Pn(t).forEach(function(a){++n,e[e.length]=de("property",rJ(t[a]),{fmtid:"{D5CDD505-2E9C-101B-9397-08002B2CF9AE}",pid:n,name:ct(a)})}),e.length>2&&(e[e.length]="",e[1]=e[1].replace("/>",">")),e.join("")}var Y2={Title:"Title",Subject:"Subject",Author:"Author",Keywords:"Keywords",Comments:"Description",LastAuthor:"LastAuthor",RevNumber:"Revision",Application:"AppName",LastPrinted:"LastPrinted",CreatedDate:"Created",ModifiedDate:"LastSaved",Category:"Category",Manager:"Manager",Company:"Company",AppVersion:"Version",ContentStatus:"ContentStatus",Identifier:"Identifier",Language:"Language"};function VJ(t,e){var n=[];return Pn(Y2).map(function(r){for(var a=0;a'+a.join("")+""}function zJ(t){var e=typeof t=="string"?new Date(Date.parse(t)):t,n=e.getTime()/1e3+11644473600,r=n%Math.pow(2,32),a=(n-r)/Math.pow(2,32);r*=1e7,a*=1e7;var i=r/Math.pow(2,32)|0;i>0&&(r=r%Math.pow(2,32),a+=i);var s=ne(8);return s.write_shift(4,r),s.write_shift(4,a),s}function X2(t,e){var n=ne(4),r=ne(4);switch(n.write_shift(4,t==80?31:t),t){case 3:r.write_shift(-4,e);break;case 5:r=ne(8),r.write_shift(8,e,"f");break;case 11:r.write_shift(4,e?1:0);break;case 64:r=zJ(e);break;case 31:case 80:for(r=ne(4+2*(e.length+1)+(e.length%2?0:2)),r.write_shift(4,e.length+1),r.write_shift(0,e,"dbcs");r.l!=r.length;)r.write_shift(1,0);break;default:throw new Error("TypedPropertyValue unrecognized type "+t+" "+e)}return xn([n,r])}var TO=["CodePage","Thumbnail","_PID_LINKBASE","_PID_HLINKS","SystemIdentifier","FMTID"];function qJ(t){switch(typeof t){case"boolean":return 11;case"number":return(t|0)==t?3:5;case"string":return 31;case"object":if(t instanceof Date)return 64;break}return-1}function Q2(t,e,n){var r=ne(8),a=[],i=[],s=8,o=0,l=ne(8),u=ne(8);if(l.write_shift(4,2),l.write_shift(4,1200),u.write_shift(4,1),i.push(l),a.push(u),s+=8+l.length,!e){u=ne(8),u.write_shift(4,0),a.unshift(u);var c=[ne(4)];for(c[0].write_shift(4,t.length),o=0;o-1||bO.indexOf(t[o][0])>-1)&&t[o][1]!=null){var f=t[o][1],p=0;if(e){p=+e[t[o][0]];var g=n[p];if(g.p=="version"&&typeof f=="string"){var m=f.split(".");f=(+m[0]<<16)+(+m[1]||0)}l=X2(g.t,f)}else{var _=qJ(f);_==-1&&(_=31,f=String(f)),l=X2(_,f)}i.push(l),u=ne(8),u.write_shift(4,e?p:2+o),a.push(u),s+=8+l.length}var x=8*(i.length+1);for(o=0;o=12?2:1),a="sbcs-cont";if(n&&n.biff>=8,!n||n.biff==8){var i=t.read_shift(1);i&&(a="dbcs-cont")}else n.biff==12&&(a="wstr");n.biff>=2&&n.biff<=5&&(a="cpstr");var s=r?t.read_shift(r,a):"";return s}function WJ(t){var e=t.t||"",n=ne(3);n.write_shift(2,e.length),n.write_shift(1,1);var r=ne(2*e.length);r.write_shift(2*e.length,e,"utf16le");var a=[n,r];return xn(a)}function $J(t,e,n){var r;if(n){if(n.biff>=2&&n.biff<=5)return t.read_shift(e,"cpstr");if(n.biff>=12)return t.read_shift(e,"dbcs-cont")}var a=t.read_shift(1);return a===0?r=t.read_shift(e,"sbcs-cont"):r=t.read_shift(e,"dbcs-cont"),r}function KJ(t,e,n){var r=t.read_shift(n&&n.biff==2?1:2);return r===0?(t.l++,""):$J(t,r,n)}function JJ(t,e,n){if(n.biff>5)return KJ(t,e,n);var r=t.read_shift(1);return r===0?(t.l++,""):t.read_shift(r,n.biff<=4||!t.lens?"cpstr":"sbcs-cont")}function IO(t,e,n){return n||(n=ne(3+2*t.length)),n.write_shift(2,t.length),n.write_shift(1,1),n.write_shift(31,t,"utf16le"),n}function eC(t,e){e||(e=ne(6+t.length*2)),e.write_shift(4,1+t.length);for(var n=0;n-1?31:23;switch(r.charAt(0)){case"#":i=28;break;case".":i&=-3;break}e.write_shift(4,2),e.write_shift(4,i);var s=[8,6815827,6619237,4849780,83];for(n=0;n-1?r.slice(0,a):r;for(e.write_shift(4,2*(o.length+1)),n=0;n-1?r.slice(a+1):"",e)}else{for(s="03 03 00 00 00 00 00 00 c0 00 00 00 00 00 00 46".split(" "),n=0;n8?4:2,a=t.read_shift(r),i=t.read_shift(r,"i"),s=t.read_shift(r,"i");return[a,i,s]}function QJ(t){var e=t.read_shift(2),n=t.read_shift(2),r=t.read_shift(2),a=t.read_shift(2);return{s:{c:r,r:e},e:{c:a,r:n}}}function PO(t,e){return e||(e=ne(8)),e.write_shift(2,t.s.r),e.write_shift(2,t.e.r),e.write_shift(2,t.s.c),e.write_shift(2,t.e.c),e}function Pb(t,e,n){var r=1536,a=16;switch(n.bookType){case"biff8":break;case"biff5":r=1280,a=8;break;case"biff4":r=4,a=6;break;case"biff3":r=3,a=6;break;case"biff2":r=2,a=4;break;case"xla":break;default:throw new Error("unsupported BIFF version")}var i=ne(a);return i.write_shift(2,r),i.write_shift(2,e),a>4&&i.write_shift(2,29282),a>6&&i.write_shift(2,1997),a>8&&(i.write_shift(2,49161),i.write_shift(2,1),i.write_shift(2,1798),i.write_shift(2,0)),i}function ZJ(t,e){var n=!e||e.biff==8,r=ne(n?112:54);for(r.write_shift(e.biff==8?2:1,7),n&&r.write_shift(1,0),r.write_shift(4,859007059),r.write_shift(4,5458548|(n?0:536870912));r.l=8?2:1,r=ne(8+n*t.name.length);r.write_shift(4,t.pos),r.write_shift(1,t.hs||0),r.write_shift(1,t.dt),r.write_shift(1,t.name.length),e.biff>=8&&r.write_shift(1,1),r.write_shift(n*t.name.length,t.name,e.biff<8?"sbcs":"utf16le");var a=r.slice(0,r.l);return a.l=r.l,a}function tY(t,e){var n=ne(8);n.write_shift(4,t.Count),n.write_shift(4,t.Unique);for(var r=[],a=0;ar.l?r.slice(0,r.l):r;return i.l==null&&(i.l=i.length),i}function lY(t,e){var n=e.biff==8||!e.biff?4:2,r=ne(2*n+6);return r.write_shift(n,t.s.r),r.write_shift(n,t.e.r+1),r.write_shift(2,t.s.c),r.write_shift(2,t.e.c+1),r.write_shift(2,0),r}function tC(t,e,n,r){var a=n&&n.biff==5;r||(r=ne(a?16:20)),r.write_shift(2,0),t.style?(r.write_shift(2,t.numFmtId||0),r.write_shift(2,65524)):(r.write_shift(2,t.numFmtId||0),r.write_shift(2,e<<4));var i=0;return t.numFmtId>0&&a&&(i|=1024),r.write_shift(4,i),r.write_shift(4,0),a||r.write_shift(4,0),r.write_shift(2,0),r}function uY(t){var e=ne(8);return e.write_shift(4,0),e.write_shift(2,0),e.write_shift(2,0),e}function cY(t,e,n,r,a,i){var s=ne(8);return Ro(t,e,r,s),CO(n,i,s),s}function dY(t,e,n,r){var a=ne(14);return Ro(t,e,r,a),Po(n,a),a}function hY(t,e,n){if(n.biff<8)return fY(t,e,n);for(var r=[],a=t.l+e,i=t.read_shift(n.biff>8?4:2);i--!==0;)r.push(XJ(t,n.biff>8?12:6,n));if(t.l!=a)throw new Error("Bad ExternSheet: "+t.l+" != "+a);return r}function fY(t,e,n){t[t.l+1]==3&&t[t.l]++;var r=AO(t,e,n);return r.charCodeAt(0)==3?r.slice(1):r}function pY(t){var e=ne(2+t.length*8);e.write_shift(2,t.length);for(var n=0;n=12?4:2,a=t.read_shift(r),i=t.read_shift(r),s=t.read_shift(r),o=t.read_shift(r),l=t.read_shift(2);r==2&&(t.l+=2);var u={s:a,e:i,w:s,ixfe:o,flags:l};return(n.biff>=5||!n.biff)&&(u.level=l>>8&7),u}function yY(t,e){var n=ne(12);n.write_shift(2,e),n.write_shift(2,e),n.write_shift(2,t.width*256),n.write_shift(2,0);var r=0;return t.hidden&&(r|=1),n.write_shift(1,r),r=t.level||0,n.write_shift(1,r),n.write_shift(2,0),n}function EY(t){for(var e=ne(2*t),n=0;n1048576&&(m=1e6),h!=2&&(_=c.read_shift(2));var x=c.read_shift(2),E=l.codepage||1252;h!=2&&(c.l+=16,c.read_shift(1),c[c.l]!==0&&(E=t[c[c.l]]),c.l+=1,c.l+=2),g&&(c.l+=36);for(var y=[],I={},j=Math.min(c.length,h==2?521:_-10-(p?264:0)),G=g?32:11;c.l0;){if(c[c.l]===42){c.l+=x;continue}for(++c.l,u[++T]=[],S=0,S=0;S!=y.length;++S){var w=c.slice(c.l,c.l+y[S].len);c.l+=y[S].len,yr(w,0);var A=Hs.utils.decode(E,w);switch(y[S].type){case"C":A.trim().length&&(u[T][S]=A.replace(/\s+$/,""));break;case"D":A.length===8?u[T][S]=new Date(+A.slice(0,4),+A.slice(4,6)-1,+A.slice(6,8)):u[T][S]=A;break;case"F":u[T][S]=parseFloat(A.trim());break;case"+":case"I":u[T][S]=g?w.read_shift(-4,"i")^2147483648:w.read_shift(4,"i");break;case"L":switch(A.trim().toUpperCase()){case"Y":case"T":u[T][S]=!0;break;case"N":case"F":u[T][S]=!1;break;case"":case"?":break;default:throw new Error("DBF Unrecognized L:|"+A+"|")}break;case"M":if(!f)throw new Error("DBF Unexpected MEMO for type "+h.toString(16));u[T][S]="##MEMO##"+(g?parseInt(A.trim(),10):w.read_shift(4));break;case"N":A=A.replace(/\u0000/g,"").trim(),A&&A!="."&&(u[T][S]=+A||0);break;case"@":u[T][S]=new Date(w.read_shift(-8,"f")-621356832e5);break;case"T":u[T][S]=new Date((w.read_shift(4)-2440588)*864e5+w.read_shift(4));break;case"Y":u[T][S]=w.read_shift(4,"i")/1e4+w.read_shift(4,"i")/1e4*Math.pow(2,32);break;case"O":u[T][S]=-w.read_shift(-8,"f");break;case"B":if(p&&y[S].len==8){u[T][S]=w.read_shift(8,"f");break}case"G":case"P":w.l+=y[S].len;break;case"0":if(y[S].name==="_NullFlags")break;default:throw new Error("DBF Unsupported data type "+y[S].type)}}}if(h!=2&&c.l=0&&Fd(+u.codepage),u.type=="string")throw new Error("Cannot write DBF to JS string");var c=ur(),h=b0(o,{header:1,raw:!0,cellDates:!0}),f=h[0],p=h.slice(1),g=o["!cols"]||[],m=0,_=0,x=0,E=1;for(m=0;m250&&(w=250),S=((g[m]||{}).DBF||{}).type,S=="C"&&g[m].DBF.len>w&&(w=g[m].DBF.len),T=="B"&&S=="N"&&(T="N",G[m]=g[m].DBF.dec,w=g[m].DBF.len),j[m]=T=="C"||S=="N"?w:i[T]||0,E+=j[m],I[m]=T}var R=c.next(32);for(R.write_shift(4,318902576),R.write_shift(4,p.length),R.write_shift(2,296+32*x),R.write_shift(2,E),m=0;m<4;++m)R.write_shift(4,0);for(R.write_shift(4,0|(+e[kN]||3)<<8),m=0,_=0;m":190,"?":191,"{":223},e=new RegExp("\x1BN("+Pn(t).join("|").replace(/\|\|\|/,"|\\||").replace(/([?()+])/g,"\\$1")+"|\\|)","gm"),n=function(f,p){var g=t[p];return typeof g=="number"?w2(g):g},r=function(f,p,g){var m=p.charCodeAt(0)-32<<4|g.charCodeAt(0)-48;return m==59?f:w2(m)};t["|"]=254;function a(f,p){switch(p.type){case"base64":return i(pi(f),p);case"binary":return i(f,p);case"buffer":return i(st&&Buffer.isBuffer(f)?f.toString("binary"):Eh(f),p);case"array":return i(Vm(f),p)}throw new Error("Unrecognized type "+p.type)}function i(f,p){var g=f.split(/[\n\r]+/),m=-1,_=-1,x=0,E=0,y=[],I=[],j=null,G={},T=[],S=[],w=[],A=0,R;for(+p.codepage>=0&&Fd(+p.codepage);x!==g.length;++x){A=0;var L=g[x].trim().replace(/\x1B([\x20-\x2F])([\x30-\x3F])/g,r).replace(e,n),N=L.replace(/;;/g,"\0").split(";").map(function(z){return z.replace(/\u0000/g,";")}),Re=N[0],Pe;if(L.length>0)switch(Re){case"ID":break;case"E":break;case"B":break;case"O":break;case"W":break;case"P":N[1].charAt(0)=="P"&&I.push(L.slice(3).replace(/;;/g,";"));break;case"C":var ft=!1,Ue=!1,le=!1,ye=!1,we=-1,De=-1;for(E=1;E-1&&y[we][De];if(!H||!H[1])throw new Error("SYLK shared formula cannot find base");y[m][_][1]=SX(H[1],{r:m-we,c:_-De})}break;case"F":var q=0;for(E=1;E0?(T[m].hpt=A,T[m].hpx=MO(A)):A===0&&(T[m].hidden=!0);break;default:if(p&&p.WTF)throw new Error("SYLK bad record "+L)}q<1&&(j=null);break;default:if(p&&p.WTF)throw new Error("SYLK bad record "+L)}}return T.length>0&&(G["!rows"]=T),S.length>0&&(G["!cols"]=S),p&&p.sheetRows&&(y=y.slice(0,p.sheetRows)),[y,G]}function s(f,p){var g=a(f,p),m=g[0],_=g[1],x=Pu(m,p);return Pn(_).forEach(function(E){x[E]=_[E]}),x}function o(f,p){return Uo(s(f,p),p)}function l(f,p,g,m){var _="C;Y"+(g+1)+";X"+(m+1)+";K";switch(f.t){case"n":_+=f.v||0,f.f&&!f.F&&(_+=";E"+Nb(f.f,{r:g,c:m}));break;case"b":_+=f.v?"TRUE":"FALSE";break;case"e":_+=f.w||f.v;break;case"d":_+='"'+(f.w||f.v)+'"';break;case"s":_+='"'+f.v.replace(/"/g,"").replace(/;/g,";;")+'"';break}return _}function u(f,p){p.forEach(function(g,m){var _="F;W"+(m+1)+" "+(m+1)+" ";g.hidden?_+="0":(typeof g.width=="number"&&!g.wpx&&(g.wpx=v0(g.width)),typeof g.wpx=="number"&&!g.wch&&(g.wch=_0(g.wpx)),typeof g.wch=="number"&&(_+=Math.round(g.wch))),_.charAt(_.length-1)!=" "&&f.push(_)})}function c(f,p){p.forEach(function(g,m){var _="F;";g.hidden?_+="M0;":g.hpt?_+="M"+20*g.hpt+";":g.hpx&&(_+="M"+20*y0(g.hpx)+";"),_.length>2&&f.push(_+"R"+(m+1))})}function h(f,p){var g=["ID;PWXL;N;E"],m=[],_=Ct(f["!ref"]),x,E=Array.isArray(f),y=`\r `;g.push("P;PGeneral"),g.push("F;P0;DG0G8;M255"),f["!cols"]&&u(g,f["!cols"]),f["!rows"]&&c(g,f["!rows"]),g.push("B;Y"+(_.e.r-_.s.r+1)+";X"+(_.e.c-_.s.c+1)+";D"+[_.s.c,_.s.r,_.e.c,_.e.r].join(" "));for(var I=_.s.r;I<=_.e.r;++I)for(var j=_.s.c;j<=_.e.c;++j){var G=ht({r:I,c:j});x=E?(f[I]||[])[j]:f[G],!(!x||x.v==null&&(!x.f||x.F))&&m.push(l(x,f,I,j))}return g.join(y)+y+m.join(y)+y+"E"+y}return{to_workbook:o,to_sheet:s,from_sheet:h}}(),wY=function(){function t(i,s){switch(s.type){case"base64":return e(pi(i),s);case"binary":return e(i,s);case"buffer":return e(st&&Buffer.isBuffer(i)?i.toString("binary"):Eh(i),s);case"array":return e(Vm(i),s)}throw new Error("Unrecognized type "+s.type)}function e(i,s){for(var o=i.split(` `),l=-1,u=-1,c=0,h=[];c!==o.length;++c){if(o[c].trim()==="BOT"){h[++l]=[],u=0;continue}if(!(l<0)){var f=o[c].trim().split(","),p=f[0],g=f[1];++c;for(var m=o[c]||"";(m.match(/["]/g)||[]).length&1&&c=0&&g[m].length===0;)--m;for(var _=10,x=0,E=0;E<=m;++E)x=g[E].indexOf(" "),x==-1?x=g[E].length:x++,_=Math.max(_,x);for(E=0;E<=m;++E){p[E]=[];var y=0;for(t(g[E].slice(0,_).trim(),p,E,y,f),y=1;y<=(g[E].length-_)/10+1;++y)t(g[E].slice(_+(y-1)*10,_+y*10).trim(),p,E,y,f)}return f.sheetRows&&(p=p.slice(0,f.sheetRows)),p}var n={44:",",9:" ",59:";",124:"|"},r={44:3,9:2,59:1,124:0};function a(c){for(var h={},f=!1,p=0,g=0;p0&&A(),g["!ref"]=Kt(m),g}function s(c,h){return!(h&&h.PRN)||h.FS||c.slice(0,4)=="sep="||c.indexOf(" ")>=0||c.indexOf(",")>=0||c.indexOf(";")>=0?i(c,h):Pu(e(c,h),h)}function o(c,h){var f="",p=h.type=="string"?[0,0,0,0]:Bte(c,h);switch(h.type){case"base64":f=pi(c);break;case"binary":f=c;break;case"buffer":h.codepage==65001?f=c.toString("utf8"):h.codepage&&typeof Hs<"u"?f=Hs.utils.decode(h.codepage,c):f=st&&Buffer.isBuffer(c)?c.toString("binary"):Eh(c);break;case"array":f=Vm(c);break;case"string":f=c;break;default:throw new Error("Unrecognized type "+h.type)}return p[0]==239&&p[1]==187&&p[2]==191?f=Gc(f.slice(3)):h.type!="string"&&h.type!="buffer"&&h.codepage==65001?f=Gc(f):h.type=="binary"&&typeof Hs<"u"&&h.codepage&&(f=Hs.utils.decode(h.codepage,Hs.utils.encode(28591,f))),f.slice(0,19)=="socialcalc:version:"?RO.to_sheet(h.type=="string"?f:Gc(f),h):s(f,h)}function l(c,h){return Uo(o(c,h),h)}function u(c){for(var h=[],f=Ct(c["!ref"]),p,g=Array.isArray(c),m=f.s.r;m<=f.e.r;++m){for(var _=[],x=f.s.c;x<=f.e.c;++x){var E=ht({r:m,c:x});if(p=g?(c[m]||[])[x]:c[E],!p||p.v==null){_.push(" ");continue}for(var y=(p.w||(mi(p),p.w)||"").slice(0,10);y.length<10;)y+=" ";_.push(y+(x===0?" ":""))}h.push(_.join(""))}return h.join(` `)}return{to_workbook:l,to_sheet:o,from_sheet:u}}(),nC=function(){function t(V,H,q){if(V){yr(V,V.l||0);for(var z=q.Enum||we;V.l=16&&V[14]==5&&V[15]===108)throw new Error("Unsupported Works 3 for Mac file");if(V[2]==2)q.Enum=we,t(V,function(xe,Zn,Mr){switch(Mr){case 0:q.vers=xe,xe>=4096&&(q.qpro=!0);break;case 6:Ge=xe;break;case 204:xe&&(_e=xe);break;case 222:_e=xe;break;case 15:case 51:q.qpro||(xe[1].v=xe[1].v.slice(1));case 13:case 14:case 16:Mr==14&&(xe[2]&112)==112&&(xe[2]&15)>1&&(xe[2]&15)<15&&(xe[1].z=q.dateNF||Bt[14],q.cellDates&&(xe[1].t="d",xe[1].v=$N(xe[1].v))),q.qpro&&xe[3]>Ae&&(z["!ref"]=Kt(Ge),Se[re]=z,me.push(re),z=q.dense?[]:{},Ge={s:{r:0,c:0},e:{r:0,c:0}},Ae=xe[3],re=_e||"Sheet"+(Ae+1),_e="");var Hr=q.dense?(z[xe[0].r]||[])[xe[0].c]:z[ht(xe[0])];if(Hr){Hr.t=xe[1].t,Hr.v=xe[1].v,xe[1].z!=null&&(Hr.z=xe[1].z),xe[1].f!=null&&(Hr.f=xe[1].f);break}q.dense?(z[xe[0].r]||(z[xe[0].r]=[]),z[xe[0].r][xe[0].c]=xe[1]):z[ht(xe[0])]=xe[1];break}},q);else if(V[2]==26||V[2]==14)q.Enum=De,V[2]==14&&(q.qpro=!0,V.l=0),t(V,function(xe,Zn,Mr){switch(Mr){case 204:re=xe;break;case 22:xe[1].v=xe[1].v.slice(1);case 23:case 24:case 25:case 37:case 39:case 40:if(xe[3]>Ae&&(z["!ref"]=Kt(Ge),Se[re]=z,me.push(re),z=q.dense?[]:{},Ge={s:{r:0,c:0},e:{r:0,c:0}},Ae=xe[3],re="Sheet"+(Ae+1)),Xt>0&&xe[0].r>=Xt)break;q.dense?(z[xe[0].r]||(z[xe[0].r]=[]),z[xe[0].r][xe[0].c]=xe[1]):z[ht(xe[0])]=xe[1],Ge.e.c=0&&Fd(+q.codepage),q.type=="string")throw new Error("Cannot write WK1 to JS string");var z=ur(),re=Ct(V["!ref"]),_e=Array.isArray(V),Ae=[];he(z,0,i(1030)),he(z,6,l(re));for(var Se=Math.min(re.e.r,8191),me=re.s.r;me<=Se;++me)for(var tt=Cn(me),Ge=re.s.c;Ge<=re.e.c;++Ge){me===re.s.r&&(Ae[Ge]=Un(Ge));var Xt=Ae[Ge]+tt,Ye=_e?(V[me]||[])[Ge]:V[Xt];if(!(!Ye||Ye.t=="z"))if(Ye.t=="n")(Ye.v|0)==Ye.v&&Ye.v>=-32768&&Ye.v<=32767?he(z,13,p(me,Ge,Ye.v)):he(z,14,m(me,Ge,Ye.v));else{var fr=mi(Ye);he(z,15,h(me,Ge,fr.slice(0,239)))}}return he(z,1),z.end()}function a(V,H){var q=H||{};if(+q.codepage>=0&&Fd(+q.codepage),q.type=="string")throw new Error("Cannot write WK3 to JS string");var z=ur();he(z,0,s(V));for(var re=0,_e=0;re8191&&(q=8191),H.write_shift(2,q),H.write_shift(1,re),H.write_shift(1,z),H.write_shift(2,0),H.write_shift(2,0),H.write_shift(1,1),H.write_shift(1,2),H.write_shift(4,0),H.write_shift(4,0),H}function o(V,H,q){var z={s:{c:0,r:0},e:{c:0,r:0}};return H==8&&q.qpro?(z.s.c=V.read_shift(1),V.l++,z.s.r=V.read_shift(2),z.e.c=V.read_shift(1),V.l++,z.e.r=V.read_shift(2),z):(z.s.c=V.read_shift(2),z.s.r=V.read_shift(2),H==12&&q.qpro&&(V.l+=2),z.e.c=V.read_shift(2),z.e.r=V.read_shift(2),H==12&&q.qpro&&(V.l+=2),z.s.c==65535&&(z.s.c=z.e.c=z.s.r=z.e.r=0),z)}function l(V){var H=ne(8);return H.write_shift(2,V.s.c),H.write_shift(2,V.s.r),H.write_shift(2,V.e.c),H.write_shift(2,V.e.r),H}function u(V,H,q){var z=[{c:0,r:0},{t:"n",v:0},0,0];return q.qpro&&q.vers!=20768?(z[0].c=V.read_shift(1),z[3]=V.read_shift(1),z[0].r=V.read_shift(2),V.l+=2):(z[2]=V.read_shift(1),z[0].c=V.read_shift(2),z[0].r=V.read_shift(2)),z}function c(V,H,q){var z=V.l+H,re=u(V,H,q);if(re[1].t="s",q.vers==20768){V.l++;var _e=V.read_shift(1);return re[1].v=V.read_shift(_e,"utf8"),re}return q.qpro&&V.l++,re[1].v=V.read_shift(z-V.l,"cstr"),re}function h(V,H,q){var z=ne(7+q.length);z.write_shift(1,255),z.write_shift(2,H),z.write_shift(2,V),z.write_shift(1,39);for(var re=0;re=128?95:_e)}return z.write_shift(1,0),z}function f(V,H,q){var z=u(V,H,q);return z[1].v=V.read_shift(2,"i"),z}function p(V,H,q){var z=ne(7);return z.write_shift(1,255),z.write_shift(2,H),z.write_shift(2,V),z.write_shift(2,q,"i"),z}function g(V,H,q){var z=u(V,H,q);return z[1].v=V.read_shift(8,"f"),z}function m(V,H,q){var z=ne(13);return z.write_shift(1,255),z.write_shift(2,H),z.write_shift(2,V),z.write_shift(8,q,"f"),z}function _(V,H,q){var z=V.l+H,re=u(V,H,q);if(re[1].v=V.read_shift(8,"f"),q.qpro)V.l=z;else{var _e=V.read_shift(2);I(V.slice(V.l,V.l+_e),re),V.l+=_e}return re}function x(V,H,q){var z=H&32768;return H&=-32769,H=(z?V:0)+(H>=8192?H-16384:H),(z?"":"$")+(q?Un(H):Cn(H))}var E={51:["FALSE",0],52:["TRUE",0],70:["LEN",1],80:["SUM",69],81:["AVERAGEA",69],82:["COUNTA",69],83:["MINA",69],84:["MAXA",69],111:["T",1]},y=["","","","","","","","","","+","-","*","/","^","=","<>","<=",">=","<",">","","","","","&","","","","","","",""];function I(V,H){yr(V,0);for(var q=[],z=0,re="",_e="",Ae="",Se="";V.lq.length){console.error("WK1 bad formula parse 0x"+me.toString(16)+":|"+q.join("|")+"|");return}var Ye=q.slice(-z);q.length-=z,q.push(E[me][0]+"("+Ye.join(",")+")")}else return me<=7?console.error("WK1 invalid opcode "+me.toString(16)):me<=24?console.error("WK1 unsupported op "+me.toString(16)):me<=30?console.error("WK1 invalid opcode "+me.toString(16)):me<=115?console.error("WK1 unsupported function opcode "+me.toString(16)):console.error("WK1 unrecognized opcode "+me.toString(16))}}q.length==1?H[1].f=""+q[0]:console.error("WK1 bad formula parse |"+q.join("|")+"|")}function j(V){var H=[{c:0,r:0},{t:"n",v:0},0];return H[0].r=V.read_shift(2),H[3]=V[V.l++],H[0].c=V[V.l++],H}function G(V,H){var q=j(V);return q[1].t="s",q[1].v=V.read_shift(H-4,"cstr"),q}function T(V,H,q,z){var re=ne(6+z.length);re.write_shift(2,V),re.write_shift(1,q),re.write_shift(1,H),re.write_shift(1,39);for(var _e=0;_e=128?95:Ae)}return re.write_shift(1,0),re}function S(V,H){var q=j(V);q[1].v=V.read_shift(2);var z=q[1].v>>1;if(q[1].v&1)switch(z&7){case 0:z=(z>>3)*5e3;break;case 1:z=(z>>3)*500;break;case 2:z=(z>>3)/20;break;case 3:z=(z>>3)/200;break;case 4:z=(z>>3)/2e3;break;case 5:z=(z>>3)/2e4;break;case 6:z=(z>>3)/16;break;case 7:z=(z>>3)/64;break}return q[1].v=z,q}function w(V,H){var q=j(V),z=V.read_shift(4),re=V.read_shift(4),_e=V.read_shift(2);if(_e==65535)return z===0&&re===3221225472?(q[1].t="e",q[1].v=15):z===0&&re===3489660928?(q[1].t="e",q[1].v=42):q[1].v=0,q;var Ae=_e&32768;return _e=(_e&32767)-16446,q[1].v=(1-Ae*2)*(re*Math.pow(2,_e+32)+z*Math.pow(2,_e)),q}function A(V,H,q,z){var re=ne(14);if(re.write_shift(2,V),re.write_shift(1,q),re.write_shift(1,H),z==0)return re.write_shift(4,0),re.write_shift(4,0),re.write_shift(2,65535),re;var _e=0,Ae=0,Se=0,me=0;return z<0&&(_e=1,z=-z),Ae=Math.log2(z)|0,z/=Math.pow(2,Ae-31),me=z>>>0,me&2147483648||(z/=2,++Ae,me=z>>>0),z-=me,me|=2147483648,me>>>=0,z*=Math.pow(2,32),Se=z>>>0,re.write_shift(4,Se),re.write_shift(4,me),Ae+=16383+(_e?32768:0),re.write_shift(2,Ae),re}function R(V,H){var q=w(V);return V.l+=H-14,q}function L(V,H){var q=j(V),z=V.read_shift(4);return q[1].v=z>>6,q}function N(V,H){var q=j(V),z=V.read_shift(8,"f");return q[1].v=z,q}function Re(V,H){var q=N(V);return V.l+=H-10,q}function Pe(V,H){return V[V.l+H-1]==0?V.read_shift(H,"cstr"):""}function ft(V,H){var q=V[V.l++];q>H-1&&(q=H-1);for(var z="";z.length127?95:re}return q[q.l++]=0,q}var we={0:{n:"BOF",f:wO},1:{n:"EOF"},2:{n:"CALCMODE"},3:{n:"CALCORDER"},4:{n:"SPLIT"},5:{n:"SYNC"},6:{n:"RANGE",f:o},7:{n:"WINDOW1"},8:{n:"COLW1"},9:{n:"WINTWO"},10:{n:"COLW2"},11:{n:"NAME"},12:{n:"BLANK"},13:{n:"INTEGER",f},14:{n:"NUMBER",f:g},15:{n:"LABEL",f:c},16:{n:"FORMULA",f:_},24:{n:"TABLE"},25:{n:"ORANGE"},26:{n:"PRANGE"},27:{n:"SRANGE"},28:{n:"FRANGE"},29:{n:"KRANGE1"},32:{n:"HRANGE"},35:{n:"KRANGE2"},36:{n:"PROTEC"},37:{n:"FOOTER"},38:{n:"HEADER"},39:{n:"SETUP"},40:{n:"MARGINS"},41:{n:"LABELFMT"},42:{n:"TITLES"},43:{n:"SHEETJS"},45:{n:"GRAPH"},46:{n:"NGRAPH"},47:{n:"CALCCOUNT"},48:{n:"UNFORMATTED"},49:{n:"CURSORW12"},50:{n:"WINDOW"},51:{n:"STRING",f:c},55:{n:"PASSWORD"},56:{n:"LOCKED"},60:{n:"QUERY"},61:{n:"QUERYNAME"},62:{n:"PRINT"},63:{n:"PRINTNAME"},64:{n:"GRAPH2"},65:{n:"GRAPHNAME"},66:{n:"ZOOM"},67:{n:"SYMSPLIT"},68:{n:"NSROWS"},69:{n:"NSCOLS"},70:{n:"RULER"},71:{n:"NNAME"},72:{n:"ACOMM"},73:{n:"AMACRO"},74:{n:"PARSE"},102:{n:"PRANGES??"},103:{n:"RRANGES??"},104:{n:"FNAME??"},105:{n:"MRANGES??"},204:{n:"SHEETNAMECS",f:Pe},222:{n:"SHEETNAMELP",f:ft},65535:{n:""}},De={0:{n:"BOF"},1:{n:"EOF"},2:{n:"PASSWORD"},3:{n:"CALCSET"},4:{n:"WINDOWSET"},5:{n:"SHEETCELLPTR"},6:{n:"SHEETLAYOUT"},7:{n:"COLUMNWIDTH"},8:{n:"HIDDENCOLUMN"},9:{n:"USERRANGE"},10:{n:"SYSTEMRANGE"},11:{n:"ZEROFORCE"},12:{n:"SORTKEYDIR"},13:{n:"FILESEAL"},14:{n:"DATAFILLNUMS"},15:{n:"PRINTMAIN"},16:{n:"PRINTSTRING"},17:{n:"GRAPHMAIN"},18:{n:"GRAPHSTRING"},19:{n:"??"},20:{n:"ERRCELL"},21:{n:"NACELL"},22:{n:"LABEL16",f:G},23:{n:"NUMBER17",f:w},24:{n:"NUMBER18",f:S},25:{n:"FORMULA19",f:R},26:{n:"FORMULA1A"},27:{n:"XFORMAT",f:le},28:{n:"DTLABELMISC"},29:{n:"DTLABELCELL"},30:{n:"GRAPHWINDOW"},31:{n:"CPA"},32:{n:"LPLAUTO"},33:{n:"QUERY"},34:{n:"HIDDENSHEET"},35:{n:"??"},37:{n:"NUMBER25",f:L},38:{n:"??"},39:{n:"NUMBER27",f:N},40:{n:"FORMULA28",f:Re},142:{n:"??"},147:{n:"??"},150:{n:"??"},151:{n:"??"},152:{n:"??"},153:{n:"??"},154:{n:"??"},155:{n:"??"},156:{n:"??"},163:{n:"??"},174:{n:"??"},175:{n:"??"},176:{n:"??"},177:{n:"??"},184:{n:"??"},185:{n:"??"},186:{n:"??"},187:{n:"??"},188:{n:"??"},195:{n:"??"},201:{n:"??"},204:{n:"SHEETNAMECS",f:Pe},205:{n:"??"},206:{n:"??"},207:{n:"??"},208:{n:"??"},256:{n:"??"},259:{n:"??"},260:{n:"??"},261:{n:"??"},262:{n:"??"},263:{n:"??"},265:{n:"??"},266:{n:"??"},267:{n:"??"},268:{n:"??"},270:{n:"??"},271:{n:"??"},384:{n:"??"},389:{n:"??"},390:{n:"??"},393:{n:"??"},396:{n:"??"},512:{n:"??"},514:{n:"??"},513:{n:"??"},516:{n:"??"},517:{n:"??"},640:{n:"??"},641:{n:"??"},642:{n:"??"},643:{n:"??"},644:{n:"??"},645:{n:"??"},646:{n:"??"},647:{n:"??"},648:{n:"??"},658:{n:"??"},659:{n:"??"},660:{n:"??"},661:{n:"??"},662:{n:"??"},665:{n:"??"},666:{n:"??"},768:{n:"??"},772:{n:"??"},1537:{n:"SHEETINFOQP",f:Ue},1600:{n:"??"},1602:{n:"??"},1793:{n:"??"},1794:{n:"??"},1795:{n:"??"},1796:{n:"??"},1920:{n:"??"},2048:{n:"??"},2049:{n:"??"},2052:{n:"??"},2688:{n:"??"},10998:{n:"??"},12849:{n:"??"},28233:{n:"??"},28484:{n:"??"},65535:{n:""}};return{sheet_to_wk1:r,book_to_wk3:a,to_workbook:e}}(),AY=/^\s|\s$|[\t\n\r]/;function kO(t,e){if(!e.bookSST)return"";var n=[Yt];n[n.length]=de("sst",null,{xmlns:Iu[0],count:t.Count,uniqueCount:t.Unique});for(var r=0;r!=t.length;++r)if(t[r]!=null){var a=t[r],i="";a.r?i+=a.r:(i+=""),i+="",n[n.length]=i}return n.length>2&&(n[n.length]="",n[1]=n[1].replace("/>",">")),n.join("")}function IY(t){return[t.read_shift(4),t.read_shift(4)]}function PY(t,e){return e||(e=ne(8)),e.write_shift(4,t.Count),e.write_shift(4,t.Unique),e}var RY=EJ;function kY(t){var e=ur();ae(e,159,PY(t));for(var n=0;n=0;--i)s=n[i],o=e&16384?1:0,l=e<<1&32767,u=o|l,e=u^s;return e^52811}var OY=function(){function t(a,i){switch(i.type){case"base64":return e(pi(a),i);case"binary":return e(a,i);case"buffer":return e(st&&Buffer.isBuffer(a)?a.toString("binary"):Eh(a),i);case"array":return e(Vm(a),i)}throw new Error("Unrecognized type "+i.type)}function e(a,i){var s=i||{},o=s.dense?[]:{},l=a.match(/\\trowd.*?\\row\b/g);if(!l.length)throw new Error("RTF missing table");var u={s:{c:0,r:0},e:{c:0,r:l.length-1}};return l.forEach(function(c,h){Array.isArray(o)&&(o[h]=[]);for(var f=/\\\w+\b/g,p=0,g,m=-1;g=f.exec(c);){switch(g[0]){case"\\cell":var _=c.slice(p,f.lastIndex-g[0].length);if(_[0]==" "&&(_=_.slice(1)),++m,_.length){var x={v:_,t:"s"};Array.isArray(o)?o[h][m]=x:o[ht({r:h,c:m})]=x}break}p=f.lastIndex}m>u.e.c&&(u.e.c=m)}),o["!ref"]=Kt(u),o}function n(a,i){return Uo(t(a,i),i)}function r(a){for(var i=["{\\rtf1\\ansi"],s=Ct(a["!ref"]),o,l=Array.isArray(a),u=s.s.r;u<=s.e.r;++u){i.push("\\trowd\\trautofit1");for(var c=s.s.c;c<=s.e.c;++c)i.push("\\cellx"+(c+1));for(i.push("\\pard\\intbl"),c=s.s.c;c<=s.e.c;++c){var h=ht({r:u,c});o=l?(a[u]||[])[c]:a[h],!(!o||o.v==null&&(!o.f||o.F))&&(i.push(" "+(o.w||(mi(o),o.w))),i.push("\\cell"))}i.push("\\pard\\intbl\\row")}return i.join("")+"}"}return{to_workbook:n,to_sheet:t,from_sheet:r}}();function rC(t){for(var e=0,n=1;e!=3;++e)n=n*256+(t[e]>255?255:t[e]<0?0:t[e]);return n.toString(16).toUpperCase().slice(1)}var MY=6,ri=MY;function v0(t){return Math.floor((t+Math.round(128/ri)/256)*ri)}function _0(t){return Math.floor((t-5)/ri*100+.5)/100}function P_(t){return Math.round((t*ri+5)/ri*256)/256}function Rb(t){t.width?(t.wpx=v0(t.width),t.wch=_0(t.wpx),t.MDW=ri):t.wpx?(t.wch=_0(t.wpx),t.width=P_(t.wch),t.MDW=ri):typeof t.wch=="number"&&(t.width=P_(t.wch),t.wpx=v0(t.width),t.MDW=ri),t.customWidth&&delete t.customWidth}var LY=96,OO=LY;function y0(t){return t*96/OO}function MO(t){return t*OO/96}function DY(t){var e=[""];return[[5,8],[23,26],[41,44],[50,392]].forEach(function(n){for(var r=n[0];r<=n[1];++r)t[r]!=null&&(e[e.length]=de("numFmt",null,{numFmtId:r,formatCode:ct(t[r])}))}),e.length===1?"":(e[e.length]="",e[0]=de("numFmts",null,{count:e.length-2}).replace("/>",">"),e.join(""))}function FY(t){var e=[];return e[e.length]=de("cellXfs",null),t.forEach(function(n){e[e.length]=de("xf",null,n)}),e[e.length]="",e.length===2?"":(e[0]=de("cellXfs",null,{count:e.length-2}).replace("/>",">"),e.join(""))}function LO(t,e){var n=[Yt,de("styleSheet",null,{xmlns:Iu[0],"xmlns:vt":cn.vt})],r;return t.SSF&&(r=DY(t.SSF))!=null&&(n[n.length]=r),n[n.length]='',n[n.length]='',n[n.length]='',n[n.length]='',(r=FY(e.cellXfs))&&(n[n.length]=r),n[n.length]='',n[n.length]='',n[n.length]='',n.length>2&&(n[n.length]="",n[1]=n[1].replace("/>",">")),n.join("")}function BY(t,e){var n=t.read_shift(2),r=Vn(t);return[n,r]}function UY(t,e,n){n||(n=ne(6+4*e.length)),n.write_shift(2,t),hn(e,n);var r=n.length>n.l?n.slice(0,n.l):n;return n.l==null&&(n.l=n.length),r}function VY(t,e,n){var r={};r.sz=t.read_shift(2)/20;var a=AJ(t);a.fItalic&&(r.italic=1),a.fCondense&&(r.condense=1),a.fExtend&&(r.extend=1),a.fShadow&&(r.shadow=1),a.fOutline&&(r.outline=1),a.fStrikeout&&(r.strike=1);var i=t.read_shift(2);switch(i===700&&(r.bold=1),t.read_shift(2)){case 1:r.vertAlign="superscript";break;case 2:r.vertAlign="subscript";break}var s=t.read_shift(1);s!=0&&(r.underline=s);var o=t.read_shift(1);o>0&&(r.family=o);var l=t.read_shift(1);switch(l>0&&(r.charset=l),t.l++,r.color=CJ(t),t.read_shift(1)){case 1:r.scheme="major";break;case 2:r.scheme="minor";break}return r.name=Vn(t),r}function jY(t,e){e||(e=ne(25+4*32)),e.write_shift(2,t.sz*20),IJ(t,e),e.write_shift(2,t.bold?700:400);var n=0;t.vertAlign=="superscript"?n=1:t.vertAlign=="subscript"&&(n=2),e.write_shift(2,n),e.write_shift(1,t.underline||0),e.write_shift(1,t.family||0),e.write_shift(1,t.charset||0),e.write_shift(1,0),m0(t.color,e);var r=0;return t.scheme=="major"&&(r=1),t.scheme=="minor"&&(r=2),e.write_shift(1,r),hn(t.name,e),e.length>e.l?e.slice(0,e.l):e}var zY=["none","solid","mediumGray","darkGray","lightGray","darkHorizontal","darkVertical","darkDown","darkUp","darkGrid","darkTrellis","lightHorizontal","lightVertical","lightDown","lightUp","lightGrid","lightTrellis","gray125","gray0625"],dv,qY=Ma;function aC(t,e){e||(e=ne(4*3+8*7+16*1)),dv||(dv=_b(zY));var n=dv[t.patternType];n==null&&(n=40),e.write_shift(4,n);var r=0;if(n!=40)for(m0({auto:1},e),m0({auto:1},e);r<12;++r)e.write_shift(4,0);else{for(;r<4;++r)e.write_shift(4,0);for(;r<12;++r)e.write_shift(4,0)}return e.length>e.l?e.slice(0,e.l):e}function GY(t,e){var n=t.l+e,r=t.read_shift(2),a=t.read_shift(2);return t.l=n,{ixfe:r,numFmtId:a}}function DO(t,e,n){n||(n=ne(16)),n.write_shift(2,e||0),n.write_shift(2,t.numFmtId||0),n.write_shift(2,0),n.write_shift(2,0),n.write_shift(2,0),n.write_shift(1,0),n.write_shift(1,0);var r=0;return n.write_shift(1,r),n.write_shift(1,0),n.write_shift(1,0),n.write_shift(1,0),n}function oc(t,e){return e||(e=ne(10)),e.write_shift(1,0),e.write_shift(1,0),e.write_shift(4,0),e.write_shift(4,0),e}var HY=Ma;function WY(t,e){return e||(e=ne(51)),e.write_shift(1,0),oc(null,e),oc(null,e),oc(null,e),oc(null,e),oc(null,e),e.length>e.l?e.slice(0,e.l):e}function $Y(t,e){return e||(e=ne(12+4*10)),e.write_shift(4,t.xfId),e.write_shift(2,1),e.write_shift(1,+t.builtinId),e.write_shift(1,0),p0(t.name||"",e),e.length>e.l?e.slice(0,e.l):e}function KY(t,e,n){var r=ne(2052);return r.write_shift(4,t),p0(e,r),p0(n,r),r.length>r.l?r.slice(0,r.l):r}function JY(t,e){if(e){var n=0;[[5,8],[23,26],[41,44],[50,392]].forEach(function(r){for(var a=r[0];a<=r[1];++a)e[a]!=null&&++n}),n!=0&&(ae(t,615,oa(n)),[[5,8],[23,26],[41,44],[50,392]].forEach(function(r){for(var a=r[0];a<=r[1];++a)e[a]!=null&&ae(t,44,UY(a,e[a]))}),ae(t,616))}}function YY(t){var e=1;ae(t,611,oa(e)),ae(t,43,jY({sz:12,color:{theme:1},name:"Calibri",family:2,scheme:"minor"})),ae(t,612)}function XY(t){var e=2;ae(t,603,oa(e)),ae(t,45,aC({patternType:"none"})),ae(t,45,aC({patternType:"gray125"})),ae(t,604)}function QY(t){var e=1;ae(t,613,oa(e)),ae(t,46,WY()),ae(t,614)}function ZY(t){var e=1;ae(t,626,oa(e)),ae(t,47,DO({numFmtId:0,fontId:0,fillId:0,borderId:0},65535)),ae(t,627)}function eX(t,e){ae(t,617,oa(e.length)),e.forEach(function(n){ae(t,47,DO(n,0))}),ae(t,618)}function tX(t){var e=1;ae(t,619,oa(e)),ae(t,48,$Y({xfId:0,builtinId:0,name:"Normal"})),ae(t,620)}function nX(t){var e=0;ae(t,505,oa(e)),ae(t,506)}function rX(t){var e=0;ae(t,508,KY(e,"TableStyleMedium9","PivotStyleMedium4")),ae(t,509)}function aX(t,e){var n=ur();return ae(n,278),JY(n,t.SSF),YY(n),XY(n),QY(n),ZY(n),eX(n,e.cellXfs),tX(n),nX(n),rX(n),ae(n,279),n.end()}function FO(t,e){if(e&&e.themeXLSX)return e.themeXLSX;if(t&&typeof t.raw=="string")return t.raw;var n=[Yt];return n[n.length]='',n[n.length]="",n[n.length]='',n[n.length]='',n[n.length]='',n[n.length]='',n[n.length]='',n[n.length]='',n[n.length]='',n[n.length]='',n[n.length]='',n[n.length]='',n[n.length]='',n[n.length]='',n[n.length]='',n[n.length]="",n[n.length]='',n[n.length]="",n[n.length]='',n[n.length]='',n[n.length]='',n[n.length]='',n[n.length]='',n[n.length]='',n[n.length]='',n[n.length]='',n[n.length]='',n[n.length]='',n[n.length]='',n[n.length]='',n[n.length]='',n[n.length]='',n[n.length]='',n[n.length]='',n[n.length]='',n[n.length]='',n[n.length]='',n[n.length]='',n[n.length]='',n[n.length]='',n[n.length]='',n[n.length]='',n[n.length]='',n[n.length]='',n[n.length]='',n[n.length]='',n[n.length]='',n[n.length]='',n[n.length]='',n[n.length]='',n[n.length]='',n[n.length]="",n[n.length]="",n[n.length]='',n[n.length]='',n[n.length]='',n[n.length]='',n[n.length]='',n[n.length]='',n[n.length]='',n[n.length]='',n[n.length]='',n[n.length]='',n[n.length]='',n[n.length]='',n[n.length]='',n[n.length]='',n[n.length]='',n[n.length]='',n[n.length]='',n[n.length]='',n[n.length]='',n[n.length]='',n[n.length]='',n[n.length]='',n[n.length]='',n[n.length]='',n[n.length]='',n[n.length]='',n[n.length]='',n[n.length]='',n[n.length]='',n[n.length]='',n[n.length]='',n[n.length]='',n[n.length]='',n[n.length]="",n[n.length]="",n[n.length]='',n[n.length]="",n[n.length]='',n[n.length]='',n[n.length]="",n[n.length]='',n[n.length]='',n[n.length]='',n[n.length]="",n[n.length]='',n[n.length]="",n[n.length]='',n[n.length]="",n[n.length]='',n[n.length]='',n[n.length]="",n[n.length]='',n[n.length]="",n[n.length]="",n[n.length]="",n[n.length]='',n[n.length]='',n[n.length]='',n[n.length]="",n[n.length]="",n[n.length]="",n[n.length]="",n[n.length]='',n[n.length]="",n[n.length]="",n[n.length]="",n[n.length]="",n[n.length]='',n[n.length]="",n[n.length]="",n[n.length]="",n[n.length]="",n[n.length]='',n[n.length]="",n[n.length]='',n[n.length]='',n[n.length]="",n[n.length]="",n[n.length]="",n[n.length]='',n[n.length]='',n[n.length]="",n[n.length]='',n[n.length]='',n[n.length]='',n[n.length]="",n[n.length]='',n[n.length]="",n[n.length]='',n[n.length]="",n[n.length]='',n[n.length]='',n[n.length]="",n[n.length]='',n[n.length]="",n[n.length]="",n[n.length]="",n[n.length]="",n[n.length]="",n[n.length]="",n[n.length]='',n[n.length]="",n[n.length]="",n[n.length]='',n[n.length]="",n[n.length]="",n[n.length]="",n[n.length]="",n.join("")}function iX(t,e){return{flags:t.read_shift(4),version:t.read_shift(4),name:Vn(t)}}function sX(t){var e=ne(12+2*t.name.length);return e.write_shift(4,t.flags),e.write_shift(4,t.version),hn(t.name,e),e.slice(0,e.l)}function oX(t){for(var e=[],n=t.read_shift(4);n-- >0;)e.push([t.read_shift(4),t.read_shift(4)]);return e}function lX(t){var e=ne(4+8*t.length);e.write_shift(4,t.length);for(var n=0;n `),t.join("")}function fX(t){var e={};e.i=t.read_shift(4);var n={};n.r=t.read_shift(4),n.c=t.read_shift(4),e.r=ht(n);var r=t.read_shift(1);return r&2&&(e.l="1"),r&8&&(e.a="1"),e}var xl=1024;function UO(t,e){for(var n=[21600,21600],r=["m0,0l0",n[1],n[0],n[1],n[0],"0xe"].join(","),a=[de("xml",null,{"xmlns:v":Er.v,"xmlns:o":Er.o,"xmlns:x":Er.x,"xmlns:mv":Er.mv}).replace(/\/>/,">"),de("o:shapelayout",de("o:idmap",null,{"v:ext":"edit",data:t}),{"v:ext":"edit"}),de("v:shapetype",[de("v:stroke",null,{joinstyle:"miter"}),de("v:path",null,{gradientshapeok:"t","o:connecttype":"rect"})].join(""),{id:"_x0000_t202","o:spt":202,coordsize:n.join(","),path:r})];xl",u,de("v:shadow",null,c),de("v:path",null,{"o:connecttype":"none"}),'
','',"","",Sn("x:Anchor",[s.c+1,0,s.r+1,0,s.c+3,20,s.r+5,20].join(",")),Sn("x:AutoFill","False"),Sn("x:Row",String(s.r)),Sn("x:Column",String(s.c)),i[1].hidden?"":"","",""])}),a.push(""),a.join("")}function VO(t){var e=[Yt,de("comments",null,{xmlns:Iu[0]})],n=[];return e.push(""),t.forEach(function(r){r[1].forEach(function(a){var i=ct(a.a);n.indexOf(i)==-1&&(n.push(i),e.push(""+i+"")),a.T&&a.ID&&n.indexOf("tc="+a.ID)==-1&&(n.push("tc="+a.ID),e.push("tc="+a.ID+""))})}),n.length==0&&(n.push("SheetJ5"),e.push("SheetJ5")),e.push(""),e.push(""),t.forEach(function(r){var a=0,i=[];if(r[1][0]&&r[1][0].T&&r[1][0].ID?a=n.indexOf("tc="+r[1][0].ID):r[1].forEach(function(l){l.a&&(a=n.indexOf(ct(l.a))),i.push(l.t||"")}),e.push(''),i.length<=1)e.push(Sn("t",ct(i[0]||"")));else{for(var s=`Comment: `+i[0]+` `,o=1;o")}),e.push(""),e.length>2&&(e[e.length]="",e[1]=e[1].replace("/>",">")),e.join("")}function pX(t,e,n){var r=[Yt,de("ThreadedComments",null,{xmlns:cn.TCMNT}).replace(/[\/]>/,">")];return t.forEach(function(a){var i="";(a[1]||[]).forEach(function(s,o){if(!s.T){delete s.ID;return}s.a&&e.indexOf(s.a)==-1&&e.push(s.a);var l={ref:a[0],id:"{54EE7951-7262-4200-6969-"+("000000000000"+n.tcid++).slice(-12)+"}"};o==0?i=l.id:l.parentId=i,s.ID=l.id,s.a&&(l.personId="{54EE7950-7262-4200-6969-"+("000000000000"+e.indexOf(s.a)).slice(-12)+"}"),r.push(de("threadedComment",Sn("text",s.t||""),l))})}),r.push(""),r.join("")}function mX(t){var e=[Yt,de("personList",null,{xmlns:cn.TCMNT,"xmlns:x":Iu[0]}).replace(/[\/]>/,">")];return t.forEach(function(n,r){e.push(de("person",null,{displayName:n,id:"{54EE7950-7262-4200-6969-"+("000000000000"+r).slice(-12)+"}",userId:n,providerId:"None"}))}),e.push(""),e.join("")}function gX(t){var e={};e.iauthor=t.read_shift(4);var n=qo(t);return e.rfx=n.s,e.ref=ht(n.s),t.l+=16,e}function vX(t,e){return e==null&&(e=ne(36)),e.write_shift(4,t[1].iauthor),Ru(t[0],e),e.write_shift(4,0),e.write_shift(4,0),e.write_shift(4,0),e.write_shift(4,0),e}var _X=Vn;function yX(t){return hn(t.slice(0,54))}function EX(t){var e=ur(),n=[];return ae(e,628),ae(e,630),t.forEach(function(r){r[1].forEach(function(a){n.indexOf(a.a)>-1||(n.push(a.a.slice(0,54)),ae(e,632,yX(a.a)))})}),ae(e,631),ae(e,633),t.forEach(function(r){r[1].forEach(function(a){a.iauthor=n.indexOf(a.a);var i={s:dn(r[0]),e:dn(r[0])};ae(e,635,vX([i,a])),a.t&&a.t.length>0&&ae(e,637,xJ(a)),ae(e,636),delete a.iauthor})}),ae(e,634),ae(e,629),e.end()}function bX(t,e){e.FullPaths.forEach(function(n,r){if(r!=0){var a=n.replace(/[^\/]*[\/]/,"/_VBA_PROJECT_CUR/");a.slice(-1)!=="/"&&pt.utils.cfb_add(t,a,e.FileIndex[r].content)}})}var jO=["xlsb","xlsm","xlam","biff8","xla"],xX=function(){var t=/(^|[^A-Za-z_])R(\[?-?\d+\]|[1-9]\d*|)C(\[?-?\d+\]|[1-9]\d*|)(?![A-Za-z0-9_])/g,e={r:0,c:0};function n(r,a,i,s){var o=!1,l=!1;i.length==0?l=!0:i.charAt(0)=="["&&(l=!0,i=i.slice(1,-1)),s.length==0?o=!0:s.charAt(0)=="["&&(o=!0,s=s.slice(1,-1));var u=i.length>0?parseInt(i,10)|0:0,c=s.length>0?parseInt(s,10)|0:0;return o?c+=e.c:--c,l?u+=e.r:--u,a+(o?"":"$")+Un(c)+(l?"":"$")+Cn(u)}return function(a,i){return e=i,a.replace(t,n)}}(),kb=/(^|[^._A-Z0-9])([$]?)([A-Z]{1,2}|[A-W][A-Z]{2}|X[A-E][A-Z]|XF[A-D])([$]?)(10[0-3]\d{4}|104[0-7]\d{3}|1048[0-4]\d{2}|10485[0-6]\d|104857[0-6]|[1-9]\d{0,5})(?![_.\(A-Za-z0-9])/g,Nb=function(){return function(e,n){return e.replace(kb,function(r,a,i,s,o,l){var u=wb(s)-(i?0:n.c),c=Tb(l)-(o?0:n.r),h=c==0?"":o?c+1:"["+c+"]",f=u==0?"":i?u+1:"["+u+"]";return a+"R"+h+"C"+f})}}();function SX(t,e){return t.replace(kb,function(n,r,a,i,s,o){return r+(a=="$"?a+i:Un(wb(i)+e.c))+(s=="$"?s+o:Cn(Tb(o)+e.r))})}function TX(t){return t.length!=1}function qt(t){t.l+=1}function Ss(t,e){var n=t.read_shift(2);return[n&16383,n>>14&1,n>>15&1]}function zO(t,e,n){var r=2;if(n){if(n.biff>=2&&n.biff<=5)return qO(t);n.biff==12&&(r=4)}var a=t.read_shift(r),i=t.read_shift(r),s=Ss(t),o=Ss(t);return{s:{r:a,c:s[0],cRel:s[1],rRel:s[2]},e:{r:i,c:o[0],cRel:o[1],rRel:o[2]}}}function qO(t){var e=Ss(t),n=Ss(t),r=t.read_shift(1),a=t.read_shift(1);return{s:{r:e[0],c:r,cRel:e[1],rRel:e[2]},e:{r:n[0],c:a,cRel:n[1],rRel:n[2]}}}function wX(t,e,n){if(n.biff<8)return qO(t);var r=t.read_shift(n.biff==12?4:2),a=t.read_shift(n.biff==12?4:2),i=Ss(t),s=Ss(t);return{s:{r,c:i[0],cRel:i[1],rRel:i[2]},e:{r:a,c:s[0],cRel:s[1],rRel:s[2]}}}function GO(t,e,n){if(n&&n.biff>=2&&n.biff<=5)return CX(t);var r=t.read_shift(n&&n.biff==12?4:2),a=Ss(t);return{r,c:a[0],cRel:a[1],rRel:a[2]}}function CX(t){var e=Ss(t),n=t.read_shift(1);return{r:e[0],c:n,cRel:e[1],rRel:e[2]}}function AX(t){var e=t.read_shift(2),n=t.read_shift(2);return{r:e,c:n&255,fQuoted:!!(n&16384),cRel:n>>15,rRel:n>>15}}function IX(t,e,n){var r=n&&n.biff?n.biff:8;if(r>=2&&r<=5)return PX(t);var a=t.read_shift(r>=12?4:2),i=t.read_shift(2),s=(i&16384)>>14,o=(i&32768)>>15;if(i&=16383,o==1)for(;a>524287;)a-=1048576;if(s==1)for(;i>8191;)i=i-16384;return{r:a,c:i,cRel:s,rRel:o}}function PX(t){var e=t.read_shift(2),n=t.read_shift(1),r=(e&32768)>>15,a=(e&16384)>>14;return e&=16383,r==1&&e>=8192&&(e=e-16384),a==1&&n>=128&&(n=n-256),{r:e,c:n,cRel:a,rRel:r}}function RX(t,e,n){var r=(t[t.l++]&96)>>5,a=zO(t,n.biff>=2&&n.biff<=5?6:8,n);return[r,a]}function kX(t,e,n){var r=(t[t.l++]&96)>>5,a=t.read_shift(2,"i"),i=8;if(n)switch(n.biff){case 5:t.l+=12,i=6;break;case 12:i=12;break}var s=zO(t,i,n);return[r,a,s]}function NX(t,e,n){var r=(t[t.l++]&96)>>5;return t.l+=n&&n.biff>8?12:n.biff<8?6:8,[r]}function OX(t,e,n){var r=(t[t.l++]&96)>>5,a=t.read_shift(2),i=8;if(n)switch(n.biff){case 5:t.l+=12,i=6;break;case 12:i=12;break}return t.l+=i,[r,a]}function MX(t,e,n){var r=(t[t.l++]&96)>>5,a=wX(t,e-1,n);return[r,a]}function LX(t,e,n){var r=(t[t.l++]&96)>>5;return t.l+=n.biff==2?6:n.biff==12?14:7,[r]}function iC(t){var e=t[t.l+1]&1,n=1;return t.l+=4,[e,n]}function DX(t,e,n){t.l+=2;for(var r=t.read_shift(n&&n.biff==2?1:2),a=[],i=0;i<=r;++i)a.push(t.read_shift(n&&n.biff==2?1:2));return a}function FX(t,e,n){var r=t[t.l+1]&255?1:0;return t.l+=2,[r,t.read_shift(n&&n.biff==2?1:2)]}function BX(t,e,n){var r=t[t.l+1]&255?1:0;return t.l+=2,[r,t.read_shift(n&&n.biff==2?1:2)]}function UX(t){var e=t[t.l+1]&255?1:0;return t.l+=2,[e,t.read_shift(2)]}function VX(t,e,n){var r=t[t.l+1]&255?1:0;return t.l+=n&&n.biff==2?3:4,[r]}function HO(t){var e=t.read_shift(1),n=t.read_shift(1);return[e,n]}function jX(t){return t.read_shift(2),HO(t)}function zX(t){return t.read_shift(2),HO(t)}function qX(t,e,n){var r=(t[t.l]&96)>>5;t.l+=1;var a=GO(t,0,n);return[r,a]}function GX(t,e,n){var r=(t[t.l]&96)>>5;t.l+=1;var a=IX(t,0,n);return[r,a]}function HX(t,e,n){var r=(t[t.l]&96)>>5;t.l+=1;var a=t.read_shift(2);n&&n.biff==5&&(t.l+=12);var i=GO(t,0,n);return[r,a,i]}function WX(t,e,n){var r=(t[t.l]&96)>>5;t.l+=1;var a=t.read_shift(n&&n.biff<=3?1:2);return[WQ[a],KO[a],r]}function $X(t,e,n){var r=t[t.l++],a=t.read_shift(1),i=n&&n.biff<=3?[r==88?-1:0,t.read_shift(1)]:KX(t);return[a,(i[0]===0?KO:HQ)[i[1]]]}function KX(t){return[t[t.l+1]>>7,t.read_shift(2)&32767]}function JX(t,e,n){t.l+=n&&n.biff==2?3:4}function YX(t,e,n){if(t.l++,n&&n.biff==12)return[t.read_shift(4,"i"),0];var r=t.read_shift(2),a=t.read_shift(n&&n.biff==2?1:2);return[r,a]}function XX(t){return t.l++,Sh[t.read_shift(1)]}function QX(t){return t.l++,t.read_shift(2)}function ZX(t){return t.l++,t.read_shift(1)!==0}function eQ(t){return t.l++,ku(t)}function tQ(t,e,n){return t.l++,AO(t,e-1,n)}function nQ(t,e){var n=[t.read_shift(1)];if(e==12)switch(n[0]){case 2:n[0]=4;break;case 4:n[0]=16;break;case 0:n[0]=1;break;case 1:n[0]=2;break}switch(n[0]){case 4:n[1]=HJ(t,1)?"TRUE":"FALSE",e!=12&&(t.l+=7);break;case 37:case 16:n[1]=Sh[t[t.l]],t.l+=e==12?4:8;break;case 0:t.l+=8;break;case 1:n[1]=ku(t);break;case 2:n[1]=JJ(t,0,{biff:e>0&&e<8?2:e});break;default:throw new Error("Bad SerAr: "+n[0])}return n}function rQ(t,e,n){for(var r=t.read_shift(n.biff==12?4:2),a=[],i=0;i!=r;++i)a.push((n.biff==12?qo:QJ)(t));return a}function aQ(t,e,n){var r=0,a=0;n.biff==12?(r=t.read_shift(4),a=t.read_shift(4)):(a=1+t.read_shift(1),r=1+t.read_shift(2)),n.biff>=2&&n.biff<8&&(--r,--a==0&&(a=256));for(var i=0,s=[];i!=r&&(s[i]=[]);++i)for(var o=0;o!=a;++o)s[i][o]=nQ(t,n.biff);return s}function iQ(t,e,n){var r=t.read_shift(1)>>>5&3,a=!n||n.biff>=8?4:2,i=t.read_shift(a);switch(n.biff){case 2:t.l+=5;break;case 3:case 4:t.l+=8;break;case 5:t.l+=12;break}return[r,0,i]}function sQ(t,e,n){if(n.biff==5)return oQ(t);var r=t.read_shift(1)>>>5&3,a=t.read_shift(2),i=t.read_shift(4);return[r,a,i]}function oQ(t){var e=t.read_shift(1)>>>5&3,n=t.read_shift(2,"i");t.l+=8;var r=t.read_shift(2);return t.l+=12,[e,n,r]}function lQ(t,e,n){var r=t.read_shift(1)>>>5&3;t.l+=n&&n.biff==2?3:4;var a=t.read_shift(n&&n.biff==2?1:2);return[r,a]}function uQ(t,e,n){var r=t.read_shift(1)>>>5&3,a=t.read_shift(n&&n.biff==2?1:2);return[r,a]}function cQ(t,e,n){var r=t.read_shift(1)>>>5&3;return t.l+=4,n.biff<8&&t.l--,n.biff==12&&(t.l+=2),[r]}function dQ(t,e,n){var r=(t[t.l++]&96)>>5,a=t.read_shift(2),i=4;if(n)switch(n.biff){case 5:i=15;break;case 12:i=6;break}return t.l+=i,[r,a]}var hQ=Ma,fQ=Ma,pQ=Ma;function Th(t,e,n){return t.l+=2,[AX(t)]}function Ob(t){return t.l+=6,[]}var mQ=Th,gQ=Ob,vQ=Ob,_Q=Th;function WO(t){return t.l+=2,[wO(t),t.read_shift(2)&1]}var yQ=Th,EQ=WO,bQ=Ob,xQ=Th,SQ=Th,TQ=["Data","All","Headers","??","?Data2","??","?DataHeaders","??","Totals","??","??","??","?DataTotals","??","??","??","?Current"];function wQ(t){t.l+=2;var e=t.read_shift(2),n=t.read_shift(2),r=t.read_shift(4),a=t.read_shift(2),i=t.read_shift(2),s=TQ[n>>2&31];return{ixti:e,coltype:n&3,rt:s,idx:r,c:a,C:i}}function CQ(t){return t.l+=2,[t.read_shift(4)]}function AQ(t,e,n){return t.l+=5,t.l+=2,t.l+=n.biff==2?1:4,["PTGSHEET"]}function IQ(t,e,n){return t.l+=n.biff==2?4:5,["PTGENDSHEET"]}function PQ(t){var e=t.read_shift(1)>>>5&3,n=t.read_shift(2);return[e,n]}function RQ(t){var e=t.read_shift(1)>>>5&3,n=t.read_shift(2);return[e,n]}function kQ(t){return t.l+=4,[0,0]}var sC={1:{n:"PtgExp",f:YX},2:{n:"PtgTbl",f:pQ},3:{n:"PtgAdd",f:qt},4:{n:"PtgSub",f:qt},5:{n:"PtgMul",f:qt},6:{n:"PtgDiv",f:qt},7:{n:"PtgPower",f:qt},8:{n:"PtgConcat",f:qt},9:{n:"PtgLt",f:qt},10:{n:"PtgLe",f:qt},11:{n:"PtgEq",f:qt},12:{n:"PtgGe",f:qt},13:{n:"PtgGt",f:qt},14:{n:"PtgNe",f:qt},15:{n:"PtgIsect",f:qt},16:{n:"PtgUnion",f:qt},17:{n:"PtgRange",f:qt},18:{n:"PtgUplus",f:qt},19:{n:"PtgUminus",f:qt},20:{n:"PtgPercent",f:qt},21:{n:"PtgParen",f:qt},22:{n:"PtgMissArg",f:qt},23:{n:"PtgStr",f:tQ},26:{n:"PtgSheet",f:AQ},27:{n:"PtgEndSheet",f:IQ},28:{n:"PtgErr",f:XX},29:{n:"PtgBool",f:ZX},30:{n:"PtgInt",f:QX},31:{n:"PtgNum",f:eQ},32:{n:"PtgArray",f:LX},33:{n:"PtgFunc",f:WX},34:{n:"PtgFuncVar",f:$X},35:{n:"PtgName",f:iQ},36:{n:"PtgRef",f:qX},37:{n:"PtgArea",f:RX},38:{n:"PtgMemArea",f:lQ},39:{n:"PtgMemErr",f:hQ},40:{n:"PtgMemNoMem",f:fQ},41:{n:"PtgMemFunc",f:uQ},42:{n:"PtgRefErr",f:cQ},43:{n:"PtgAreaErr",f:NX},44:{n:"PtgRefN",f:GX},45:{n:"PtgAreaN",f:MX},46:{n:"PtgMemAreaN",f:PQ},47:{n:"PtgMemNoMemN",f:RQ},57:{n:"PtgNameX",f:sQ},58:{n:"PtgRef3d",f:HX},59:{n:"PtgArea3d",f:kX},60:{n:"PtgRefErr3d",f:dQ},61:{n:"PtgAreaErr3d",f:OX},255:{}},NQ={64:32,96:32,65:33,97:33,66:34,98:34,67:35,99:35,68:36,100:36,69:37,101:37,70:38,102:38,71:39,103:39,72:40,104:40,73:41,105:41,74:42,106:42,75:43,107:43,76:44,108:44,77:45,109:45,78:46,110:46,79:47,111:47,88:34,120:34,89:57,121:57,90:58,122:58,91:59,123:59,92:60,124:60,93:61,125:61},OQ={1:{n:"PtgElfLel",f:WO},2:{n:"PtgElfRw",f:xQ},3:{n:"PtgElfCol",f:mQ},6:{n:"PtgElfRwV",f:SQ},7:{n:"PtgElfColV",f:_Q},10:{n:"PtgElfRadical",f:yQ},11:{n:"PtgElfRadicalS",f:bQ},13:{n:"PtgElfColS",f:gQ},15:{n:"PtgElfColSV",f:vQ},16:{n:"PtgElfRadicalLel",f:EQ},25:{n:"PtgList",f:wQ},29:{n:"PtgSxName",f:CQ},255:{}},MQ={0:{n:"PtgAttrNoop",f:kQ},1:{n:"PtgAttrSemi",f:VX},2:{n:"PtgAttrIf",f:BX},4:{n:"PtgAttrChoose",f:DX},8:{n:"PtgAttrGoto",f:FX},16:{n:"PtgAttrSum",f:JX},32:{n:"PtgAttrBaxcel",f:iC},33:{n:"PtgAttrBaxcel",f:iC},64:{n:"PtgAttrSpace",f:jX},65:{n:"PtgAttrSpaceSemi",f:zX},128:{n:"PtgAttrIfError",f:UX},255:{}};function LQ(t,e,n,r){if(r.biff<8)return Ma(t,e);for(var a=t.l+e,i=[],s=0;s!==n.length;++s)switch(n[s][0]){case"PtgArray":n[s][1]=aQ(t,0,r),i.push(n[s][1]);break;case"PtgMemArea":n[s][2]=rQ(t,n[s][1],r),i.push(n[s][2]);break;case"PtgExp":r&&r.biff==12&&(n[s][1][1]=t.read_shift(4),i.push(n[s][1]));break;case"PtgList":case"PtgElfRadicalS":case"PtgElfColS":case"PtgElfColSV":throw"Unsupported "+n[s][0]}return e=a-t.l,e!==0&&i.push(Ma(t,e)),i}function DQ(t,e,n){for(var r=t.l+e,a,i,s=[];r!=t.l;)e=r-t.l,i=t[t.l],a=sC[i]||sC[NQ[i]],(i===24||i===25)&&(a=(i===24?OQ:MQ)[t[t.l+1]]),!a||!a.f?Ma(t,e):s.push([a.n,a.f(t,e,n)]);return s}function FQ(t){for(var e=[],n=0;n=",PtgGt:">",PtgLe:"<=",PtgLt:"<",PtgMul:"*",PtgNe:"<>",PtgPower:"^",PtgSub:"-"};function UQ(t,e){if(!t&&!(e&&e.biff<=5&&e.biff>=2))throw new Error("empty sheet name");return/[^\w\u4E00-\u9FFF\u3040-\u30FF]/.test(t)?"'"+t+"'":t}function $O(t,e,n){if(!t)return"SH33TJSERR0";if(n.biff>8&&(!t.XTI||!t.XTI[e]))return t.SheetNames[e];if(!t.XTI)return"SH33TJSERR6";var r=t.XTI[e];if(n.biff<8)return e>1e4&&(e-=65536),e<0&&(e=-e),e==0?"":t.XTI[e-1];if(!r)return"SH33TJSERR1";var a="";if(n.biff>8)switch(t[r[0]][0]){case 357:return a=r[1]==-1?"#REF":t.SheetNames[r[1]],r[1]==r[2]?a:a+":"+t.SheetNames[r[2]];case 358:return n.SID!=null?t.SheetNames[n.SID]:"SH33TJSSAME"+t[r[0]][0];case 355:default:return"SH33TJSSRC"+t[r[0]][0]}switch(t[r[0]][0][0]){case 1025:return a=r[1]==-1?"#REF":t.SheetNames[r[1]]||"SH33TJSERR3",r[1]==r[2]?a:a+":"+t.SheetNames[r[2]];case 14849:return t[r[0]].slice(1).map(function(i){return i.Name}).join(";;");default:return t[r[0]][0][3]?(a=r[1]==-1?"#REF":t[r[0]][0][3][r[1]]||"SH33TJSERR4",r[1]==r[2]?a:a+":"+t[r[0]][0][3][r[2]]):"SH33TJSERR2"}}function oC(t,e,n){var r=$O(t,e,n);return r=="#REF"?r:UQ(r,n)}function uu(t,e,n,r,a){var i=a&&a.biff||8,s={s:{c:0,r:0},e:{c:0,r:0}},o=[],l,u,c,h=0,f=0,p,g="";if(!t[0]||!t[0][0])return"";for(var m=-1,_="",x=0,E=t[0].length;x=0){switch(t[0][m][1][0]){case 0:_=Dt(" ",t[0][m][1][1]);break;case 1:_=Dt("\r",t[0][m][1][1]);break;default:if(_="",a.WTF)throw new Error("Unexpected PtgAttrSpaceType "+t[0][m][1][0])}u=u+_,m=-1}o.push(u+BQ[y[0]]+l);break;case"PtgIsect":l=o.pop(),u=o.pop(),o.push(u+" "+l);break;case"PtgUnion":l=o.pop(),u=o.pop(),o.push(u+","+l);break;case"PtgRange":l=o.pop(),u=o.pop(),o.push(u+":"+l);break;case"PtgAttrChoose":break;case"PtgAttrGoto":break;case"PtgAttrIf":break;case"PtgAttrIfError":break;case"PtgRef":c=Wc(y[1][1],s,a),o.push($c(c,i));break;case"PtgRefN":c=n?Wc(y[1][1],n,a):y[1][1],o.push($c(c,i));break;case"PtgRef3d":h=y[1][1],c=Wc(y[1][2],s,a),g=oC(r,h,a),o.push(g+"!"+$c(c,i));break;case"PtgFunc":case"PtgFuncVar":var I=y[1][0],j=y[1][1];I||(I=0),I&=127;var G=I==0?[]:o.slice(-I);o.length-=I,j==="User"&&(j=G.shift()),o.push(j+"("+G.join(",")+")");break;case"PtgBool":o.push(y[1]?"TRUE":"FALSE");break;case"PtgInt":o.push(y[1]);break;case"PtgNum":o.push(String(y[1]));break;case"PtgStr":o.push('"'+y[1].replace(/"/g,'""')+'"');break;case"PtgErr":o.push(y[1]);break;case"PtgAreaN":p=H2(y[1][1],n?{s:n}:s,a),o.push(uv(p,a));break;case"PtgArea":p=H2(y[1][1],s,a),o.push(uv(p,a));break;case"PtgArea3d":h=y[1][1],p=y[1][2],g=oC(r,h,a),o.push(g+"!"+uv(p,a));break;case"PtgAttrSum":o.push("SUM("+o.pop()+")");break;case"PtgAttrBaxcel":case"PtgAttrSemi":break;case"PtgName":f=y[1][2];var T=(r.names||[])[f-1]||(r[0]||[])[f],S=T?T.Name:"SH33TJSNAME"+String(f);S&&S.slice(0,6)=="_xlfn."&&!a.xlfn&&(S=S.slice(6)),o.push(S);break;case"PtgNameX":var w=y[1][1];f=y[1][2];var A;if(a.biff<=5)w<0&&(w=-w),r[w]&&(A=r[w][f]);else{var R="";if(((r[w]||[])[0]||[])[0]==14849||(((r[w]||[])[0]||[])[0]==1025?r[w][f]&&r[w][f].itab>0&&(R=r.SheetNames[r[w][f].itab-1]+"!"):R=r.SheetNames[f-1]+"!"),r[w]&&r[w][f])R+=r[w][f].Name;else if(r[0]&&r[0][f])R+=r[0][f].Name;else{var L=($O(r,w,a)||"").split(";;");L[f-1]?R=L[f-1]:R+="SH33TJSERRX"}o.push(R);break}A||(A={Name:"SH33TJSERRY"}),o.push(A.Name);break;case"PtgParen":var N="(",Re=")";if(m>=0){switch(_="",t[0][m][1][0]){case 2:N=Dt(" ",t[0][m][1][1])+N;break;case 3:N=Dt("\r",t[0][m][1][1])+N;break;case 4:Re=Dt(" ",t[0][m][1][1])+Re;break;case 5:Re=Dt("\r",t[0][m][1][1])+Re;break;default:if(a.WTF)throw new Error("Unexpected PtgAttrSpaceType "+t[0][m][1][0])}m=-1}o.push(N+o.pop()+Re);break;case"PtgRefErr":o.push("#REF!");break;case"PtgRefErr3d":o.push("#REF!");break;case"PtgExp":c={c:y[1][1],r:y[1][0]};var Pe={c:n.c,r:n.r};if(r.sharedf[ht(c)]){var ft=r.sharedf[ht(c)];o.push(uu(ft,s,Pe,r,a))}else{var Ue=!1;for(l=0;l!=r.arrayf.length;++l)if(u=r.arrayf[l],!(c.cu[0].e.c)&&!(c.ru[0].e.r)){o.push(uu(u[1],s,Pe,r,a)),Ue=!0;break}Ue||o.push(y[1])}break;case"PtgArray":o.push("{"+FQ(y[1])+"}");break;case"PtgMemArea":break;case"PtgAttrSpace":case"PtgAttrSpaceSemi":m=x;break;case"PtgTbl":break;case"PtgMemErr":break;case"PtgMissArg":o.push("");break;case"PtgAreaErr":o.push("#REF!");break;case"PtgAreaErr3d":o.push("#REF!");break;case"PtgList":o.push("Table"+y[1].idx+"[#"+y[1].rt+"]");break;case"PtgMemAreaN":case"PtgMemNoMemN":case"PtgAttrNoop":case"PtgSheet":case"PtgEndSheet":break;case"PtgMemFunc":break;case"PtgMemNoMem":break;case"PtgElfCol":case"PtgElfColS":case"PtgElfColSV":case"PtgElfColV":case"PtgElfLel":case"PtgElfRadical":case"PtgElfRadicalLel":case"PtgElfRadicalS":case"PtgElfRw":case"PtgElfRwV":throw new Error("Unsupported ELFs");case"PtgSxName":throw new Error("Unrecognized Formula Token: "+String(y));default:throw new Error("Unrecognized Formula Token: "+String(y))}var le=["PtgAttrSpace","PtgAttrSpaceSemi","PtgAttrGoto"];if(a.biff!=3&&m>=0&&le.indexOf(t[0][x][0])==-1){y=t[0][m];var ye=!0;switch(y[1][0]){case 4:ye=!1;case 0:_=Dt(" ",y[1][1]);break;case 5:ye=!1;case 1:_=Dt("\r",y[1][1]);break;default:if(_="",a.WTF)throw new Error("Unexpected PtgAttrSpaceType "+y[1][0])}o.push((ye?_:"")+o.pop()+(ye?"":_)),m=-1}}if(o.length>1&&a.WTF)throw new Error("bad formula stack");return o[0]}function VQ(t){if(t==null){var e=ne(8);return e.write_shift(1,3),e.write_shift(1,0),e.write_shift(2,0),e.write_shift(2,0),e.write_shift(2,65535),e}else if(typeof t=="number")return Po(t);return Po(0)}function jQ(t,e,n,r,a){var i=Ro(e,n,a),s=VQ(t.v),o=ne(6),l=33;o.write_shift(2,l),o.write_shift(4,0);for(var u=ne(t.bf.length),c=0;c0?LQ(t,i,a,n):null;return[a,s]}var zQ=jm,zm=jm,qQ=jm,GQ=jm,HQ={0:"BEEP",1:"OPEN",2:"OPEN.LINKS",3:"CLOSE.ALL",4:"SAVE",5:"SAVE.AS",6:"FILE.DELETE",7:"PAGE.SETUP",8:"PRINT",9:"PRINTER.SETUP",10:"QUIT",11:"NEW.WINDOW",12:"ARRANGE.ALL",13:"WINDOW.SIZE",14:"WINDOW.MOVE",15:"FULL",16:"CLOSE",17:"RUN",22:"SET.PRINT.AREA",23:"SET.PRINT.TITLES",24:"SET.PAGE.BREAK",25:"REMOVE.PAGE.BREAK",26:"FONT",27:"DISPLAY",28:"PROTECT.DOCUMENT",29:"PRECISION",30:"A1.R1C1",31:"CALCULATE.NOW",32:"CALCULATION",34:"DATA.FIND",35:"EXTRACT",36:"DATA.DELETE",37:"SET.DATABASE",38:"SET.CRITERIA",39:"SORT",40:"DATA.SERIES",41:"TABLE",42:"FORMAT.NUMBER",43:"ALIGNMENT",44:"STYLE",45:"BORDER",46:"CELL.PROTECTION",47:"COLUMN.WIDTH",48:"UNDO",49:"CUT",50:"COPY",51:"PASTE",52:"CLEAR",53:"PASTE.SPECIAL",54:"EDIT.DELETE",55:"INSERT",56:"FILL.RIGHT",57:"FILL.DOWN",61:"DEFINE.NAME",62:"CREATE.NAMES",63:"FORMULA.GOTO",64:"FORMULA.FIND",65:"SELECT.LAST.CELL",66:"SHOW.ACTIVE.CELL",67:"GALLERY.AREA",68:"GALLERY.BAR",69:"GALLERY.COLUMN",70:"GALLERY.LINE",71:"GALLERY.PIE",72:"GALLERY.SCATTER",73:"COMBINATION",74:"PREFERRED",75:"ADD.OVERLAY",76:"GRIDLINES",77:"SET.PREFERRED",78:"AXES",79:"LEGEND",80:"ATTACH.TEXT",81:"ADD.ARROW",82:"SELECT.CHART",83:"SELECT.PLOT.AREA",84:"PATTERNS",85:"MAIN.CHART",86:"OVERLAY",87:"SCALE",88:"FORMAT.LEGEND",89:"FORMAT.TEXT",90:"EDIT.REPEAT",91:"PARSE",92:"JUSTIFY",93:"HIDE",94:"UNHIDE",95:"WORKSPACE",96:"FORMULA",97:"FORMULA.FILL",98:"FORMULA.ARRAY",99:"DATA.FIND.NEXT",100:"DATA.FIND.PREV",101:"FORMULA.FIND.NEXT",102:"FORMULA.FIND.PREV",103:"ACTIVATE",104:"ACTIVATE.NEXT",105:"ACTIVATE.PREV",106:"UNLOCKED.NEXT",107:"UNLOCKED.PREV",108:"COPY.PICTURE",109:"SELECT",110:"DELETE.NAME",111:"DELETE.FORMAT",112:"VLINE",113:"HLINE",114:"VPAGE",115:"HPAGE",116:"VSCROLL",117:"HSCROLL",118:"ALERT",119:"NEW",120:"CANCEL.COPY",121:"SHOW.CLIPBOARD",122:"MESSAGE",124:"PASTE.LINK",125:"APP.ACTIVATE",126:"DELETE.ARROW",127:"ROW.HEIGHT",128:"FORMAT.MOVE",129:"FORMAT.SIZE",130:"FORMULA.REPLACE",131:"SEND.KEYS",132:"SELECT.SPECIAL",133:"APPLY.NAMES",134:"REPLACE.FONT",135:"FREEZE.PANES",136:"SHOW.INFO",137:"SPLIT",138:"ON.WINDOW",139:"ON.DATA",140:"DISABLE.INPUT",142:"OUTLINE",143:"LIST.NAMES",144:"FILE.CLOSE",145:"SAVE.WORKBOOK",146:"DATA.FORM",147:"COPY.CHART",148:"ON.TIME",149:"WAIT",150:"FORMAT.FONT",151:"FILL.UP",152:"FILL.LEFT",153:"DELETE.OVERLAY",155:"SHORT.MENUS",159:"SET.UPDATE.STATUS",161:"COLOR.PALETTE",162:"DELETE.STYLE",163:"WINDOW.RESTORE",164:"WINDOW.MAXIMIZE",166:"CHANGE.LINK",167:"CALCULATE.DOCUMENT",168:"ON.KEY",169:"APP.RESTORE",170:"APP.MOVE",171:"APP.SIZE",172:"APP.MINIMIZE",173:"APP.MAXIMIZE",174:"BRING.TO.FRONT",175:"SEND.TO.BACK",185:"MAIN.CHART.TYPE",186:"OVERLAY.CHART.TYPE",187:"SELECT.END",188:"OPEN.MAIL",189:"SEND.MAIL",190:"STANDARD.FONT",191:"CONSOLIDATE",192:"SORT.SPECIAL",193:"GALLERY.3D.AREA",194:"GALLERY.3D.COLUMN",195:"GALLERY.3D.LINE",196:"GALLERY.3D.PIE",197:"VIEW.3D",198:"GOAL.SEEK",199:"WORKGROUP",200:"FILL.GROUP",201:"UPDATE.LINK",202:"PROMOTE",203:"DEMOTE",204:"SHOW.DETAIL",206:"UNGROUP",207:"OBJECT.PROPERTIES",208:"SAVE.NEW.OBJECT",209:"SHARE",210:"SHARE.NAME",211:"DUPLICATE",212:"APPLY.STYLE",213:"ASSIGN.TO.OBJECT",214:"OBJECT.PROTECTION",215:"HIDE.OBJECT",216:"SET.EXTRACT",217:"CREATE.PUBLISHER",218:"SUBSCRIBE.TO",219:"ATTRIBUTES",220:"SHOW.TOOLBAR",222:"PRINT.PREVIEW",223:"EDIT.COLOR",224:"SHOW.LEVELS",225:"FORMAT.MAIN",226:"FORMAT.OVERLAY",227:"ON.RECALC",228:"EDIT.SERIES",229:"DEFINE.STYLE",240:"LINE.PRINT",243:"ENTER.DATA",249:"GALLERY.RADAR",250:"MERGE.STYLES",251:"EDITION.OPTIONS",252:"PASTE.PICTURE",253:"PASTE.PICTURE.LINK",254:"SPELLING",256:"ZOOM",259:"INSERT.OBJECT",260:"WINDOW.MINIMIZE",265:"SOUND.NOTE",266:"SOUND.PLAY",267:"FORMAT.SHAPE",268:"EXTEND.POLYGON",269:"FORMAT.AUTO",272:"GALLERY.3D.BAR",273:"GALLERY.3D.SURFACE",274:"FILL.AUTO",276:"CUSTOMIZE.TOOLBAR",277:"ADD.TOOL",278:"EDIT.OBJECT",279:"ON.DOUBLECLICK",280:"ON.ENTRY",281:"WORKBOOK.ADD",282:"WORKBOOK.MOVE",283:"WORKBOOK.COPY",284:"WORKBOOK.OPTIONS",285:"SAVE.WORKSPACE",288:"CHART.WIZARD",289:"DELETE.TOOL",290:"MOVE.TOOL",291:"WORKBOOK.SELECT",292:"WORKBOOK.ACTIVATE",293:"ASSIGN.TO.TOOL",295:"COPY.TOOL",296:"RESET.TOOL",297:"CONSTRAIN.NUMERIC",298:"PASTE.TOOL",302:"WORKBOOK.NEW",305:"SCENARIO.CELLS",306:"SCENARIO.DELETE",307:"SCENARIO.ADD",308:"SCENARIO.EDIT",309:"SCENARIO.SHOW",310:"SCENARIO.SHOW.NEXT",311:"SCENARIO.SUMMARY",312:"PIVOT.TABLE.WIZARD",313:"PIVOT.FIELD.PROPERTIES",314:"PIVOT.FIELD",315:"PIVOT.ITEM",316:"PIVOT.ADD.FIELDS",318:"OPTIONS.CALCULATION",319:"OPTIONS.EDIT",320:"OPTIONS.VIEW",321:"ADDIN.MANAGER",322:"MENU.EDITOR",323:"ATTACH.TOOLBARS",324:"VBAActivate",325:"OPTIONS.CHART",328:"VBA.INSERT.FILE",330:"VBA.PROCEDURE.DEFINITION",336:"ROUTING.SLIP",338:"ROUTE.DOCUMENT",339:"MAIL.LOGON",342:"INSERT.PICTURE",343:"EDIT.TOOL",344:"GALLERY.DOUGHNUT",350:"CHART.TREND",352:"PIVOT.ITEM.PROPERTIES",354:"WORKBOOK.INSERT",355:"OPTIONS.TRANSITION",356:"OPTIONS.GENERAL",370:"FILTER.ADVANCED",373:"MAIL.ADD.MAILER",374:"MAIL.DELETE.MAILER",375:"MAIL.REPLY",376:"MAIL.REPLY.ALL",377:"MAIL.FORWARD",378:"MAIL.NEXT.LETTER",379:"DATA.LABEL",380:"INSERT.TITLE",381:"FONT.PROPERTIES",382:"MACRO.OPTIONS",383:"WORKBOOK.HIDE",384:"WORKBOOK.UNHIDE",385:"WORKBOOK.DELETE",386:"WORKBOOK.NAME",388:"GALLERY.CUSTOM",390:"ADD.CHART.AUTOFORMAT",391:"DELETE.CHART.AUTOFORMAT",392:"CHART.ADD.DATA",393:"AUTO.OUTLINE",394:"TAB.ORDER",395:"SHOW.DIALOG",396:"SELECT.ALL",397:"UNGROUP.SHEETS",398:"SUBTOTAL.CREATE",399:"SUBTOTAL.REMOVE",400:"RENAME.OBJECT",412:"WORKBOOK.SCROLL",413:"WORKBOOK.NEXT",414:"WORKBOOK.PREV",415:"WORKBOOK.TAB.SPLIT",416:"FULL.SCREEN",417:"WORKBOOK.PROTECT",420:"SCROLLBAR.PROPERTIES",421:"PIVOT.SHOW.PAGES",422:"TEXT.TO.COLUMNS",423:"FORMAT.CHARTTYPE",424:"LINK.FORMAT",425:"TRACER.DISPLAY",430:"TRACER.NAVIGATE",431:"TRACER.CLEAR",432:"TRACER.ERROR",433:"PIVOT.FIELD.GROUP",434:"PIVOT.FIELD.UNGROUP",435:"CHECKBOX.PROPERTIES",436:"LABEL.PROPERTIES",437:"LISTBOX.PROPERTIES",438:"EDITBOX.PROPERTIES",439:"PIVOT.REFRESH",440:"LINK.COMBO",441:"OPEN.TEXT",442:"HIDE.DIALOG",443:"SET.DIALOG.FOCUS",444:"ENABLE.OBJECT",445:"PUSHBUTTON.PROPERTIES",446:"SET.DIALOG.DEFAULT",447:"FILTER",448:"FILTER.SHOW.ALL",449:"CLEAR.OUTLINE",450:"FUNCTION.WIZARD",451:"ADD.LIST.ITEM",452:"SET.LIST.ITEM",453:"REMOVE.LIST.ITEM",454:"SELECT.LIST.ITEM",455:"SET.CONTROL.VALUE",456:"SAVE.COPY.AS",458:"OPTIONS.LISTS.ADD",459:"OPTIONS.LISTS.DELETE",460:"SERIES.AXES",461:"SERIES.X",462:"SERIES.Y",463:"ERRORBAR.X",464:"ERRORBAR.Y",465:"FORMAT.CHART",466:"SERIES.ORDER",467:"MAIL.LOGOFF",468:"CLEAR.ROUTING.SLIP",469:"APP.ACTIVATE.MICROSOFT",470:"MAIL.EDIT.MAILER",471:"ON.SHEET",472:"STANDARD.WIDTH",473:"SCENARIO.MERGE",474:"SUMMARY.INFO",475:"FIND.FILE",476:"ACTIVE.CELL.FONT",477:"ENABLE.TIPWIZARD",478:"VBA.MAKE.ADDIN",480:"INSERTDATATABLE",481:"WORKGROUP.OPTIONS",482:"MAIL.SEND.MAILER",485:"AUTOCORRECT",489:"POST.DOCUMENT",491:"PICKLIST",493:"VIEW.SHOW",494:"VIEW.DEFINE",495:"VIEW.DELETE",509:"SHEET.BACKGROUND",510:"INSERT.MAP.OBJECT",511:"OPTIONS.MENONO",517:"MSOCHECKS",518:"NORMAL",519:"LAYOUT",520:"RM.PRINT.AREA",521:"CLEAR.PRINT.AREA",522:"ADD.PRINT.AREA",523:"MOVE.BRK",545:"HIDECURR.NOTE",546:"HIDEALL.NOTES",547:"DELETE.NOTE",548:"TRAVERSE.NOTES",549:"ACTIVATE.NOTES",620:"PROTECT.REVISIONS",621:"UNPROTECT.REVISIONS",647:"OPTIONS.ME",653:"WEB.PUBLISH",667:"NEWWEBQUERY",673:"PIVOT.TABLE.CHART",753:"OPTIONS.SAVE",755:"OPTIONS.SPELL",808:"HIDEALL.INKANNOTS"},KO={0:"COUNT",1:"IF",2:"ISNA",3:"ISERROR",4:"SUM",5:"AVERAGE",6:"MIN",7:"MAX",8:"ROW",9:"COLUMN",10:"NA",11:"NPV",12:"STDEV",13:"DOLLAR",14:"FIXED",15:"SIN",16:"COS",17:"TAN",18:"ATAN",19:"PI",20:"SQRT",21:"EXP",22:"LN",23:"LOG10",24:"ABS",25:"INT",26:"SIGN",27:"ROUND",28:"LOOKUP",29:"INDEX",30:"REPT",31:"MID",32:"LEN",33:"VALUE",34:"TRUE",35:"FALSE",36:"AND",37:"OR",38:"NOT",39:"MOD",40:"DCOUNT",41:"DSUM",42:"DAVERAGE",43:"DMIN",44:"DMAX",45:"DSTDEV",46:"VAR",47:"DVAR",48:"TEXT",49:"LINEST",50:"TREND",51:"LOGEST",52:"GROWTH",53:"GOTO",54:"HALT",55:"RETURN",56:"PV",57:"FV",58:"NPER",59:"PMT",60:"RATE",61:"MIRR",62:"IRR",63:"RAND",64:"MATCH",65:"DATE",66:"TIME",67:"DAY",68:"MONTH",69:"YEAR",70:"WEEKDAY",71:"HOUR",72:"MINUTE",73:"SECOND",74:"NOW",75:"AREAS",76:"ROWS",77:"COLUMNS",78:"OFFSET",79:"ABSREF",80:"RELREF",81:"ARGUMENT",82:"SEARCH",83:"TRANSPOSE",84:"ERROR",85:"STEP",86:"TYPE",87:"ECHO",88:"SET.NAME",89:"CALLER",90:"DEREF",91:"WINDOWS",92:"SERIES",93:"DOCUMENTS",94:"ACTIVE.CELL",95:"SELECTION",96:"RESULT",97:"ATAN2",98:"ASIN",99:"ACOS",100:"CHOOSE",101:"HLOOKUP",102:"VLOOKUP",103:"LINKS",104:"INPUT",105:"ISREF",106:"GET.FORMULA",107:"GET.NAME",108:"SET.VALUE",109:"LOG",110:"EXEC",111:"CHAR",112:"LOWER",113:"UPPER",114:"PROPER",115:"LEFT",116:"RIGHT",117:"EXACT",118:"TRIM",119:"REPLACE",120:"SUBSTITUTE",121:"CODE",122:"NAMES",123:"DIRECTORY",124:"FIND",125:"CELL",126:"ISERR",127:"ISTEXT",128:"ISNUMBER",129:"ISBLANK",130:"T",131:"N",132:"FOPEN",133:"FCLOSE",134:"FSIZE",135:"FREADLN",136:"FREAD",137:"FWRITELN",138:"FWRITE",139:"FPOS",140:"DATEVALUE",141:"TIMEVALUE",142:"SLN",143:"SYD",144:"DDB",145:"GET.DEF",146:"REFTEXT",147:"TEXTREF",148:"INDIRECT",149:"REGISTER",150:"CALL",151:"ADD.BAR",152:"ADD.MENU",153:"ADD.COMMAND",154:"ENABLE.COMMAND",155:"CHECK.COMMAND",156:"RENAME.COMMAND",157:"SHOW.BAR",158:"DELETE.MENU",159:"DELETE.COMMAND",160:"GET.CHART.ITEM",161:"DIALOG.BOX",162:"CLEAN",163:"MDETERM",164:"MINVERSE",165:"MMULT",166:"FILES",167:"IPMT",168:"PPMT",169:"COUNTA",170:"CANCEL.KEY",171:"FOR",172:"WHILE",173:"BREAK",174:"NEXT",175:"INITIATE",176:"REQUEST",177:"POKE",178:"EXECUTE",179:"TERMINATE",180:"RESTART",181:"HELP",182:"GET.BAR",183:"PRODUCT",184:"FACT",185:"GET.CELL",186:"GET.WORKSPACE",187:"GET.WINDOW",188:"GET.DOCUMENT",189:"DPRODUCT",190:"ISNONTEXT",191:"GET.NOTE",192:"NOTE",193:"STDEVP",194:"VARP",195:"DSTDEVP",196:"DVARP",197:"TRUNC",198:"ISLOGICAL",199:"DCOUNTA",200:"DELETE.BAR",201:"UNREGISTER",204:"USDOLLAR",205:"FINDB",206:"SEARCHB",207:"REPLACEB",208:"LEFTB",209:"RIGHTB",210:"MIDB",211:"LENB",212:"ROUNDUP",213:"ROUNDDOWN",214:"ASC",215:"DBCS",216:"RANK",219:"ADDRESS",220:"DAYS360",221:"TODAY",222:"VDB",223:"ELSE",224:"ELSE.IF",225:"END.IF",226:"FOR.CELL",227:"MEDIAN",228:"SUMPRODUCT",229:"SINH",230:"COSH",231:"TANH",232:"ASINH",233:"ACOSH",234:"ATANH",235:"DGET",236:"CREATE.OBJECT",237:"VOLATILE",238:"LAST.ERROR",239:"CUSTOM.UNDO",240:"CUSTOM.REPEAT",241:"FORMULA.CONVERT",242:"GET.LINK.INFO",243:"TEXT.BOX",244:"INFO",245:"GROUP",246:"GET.OBJECT",247:"DB",248:"PAUSE",251:"RESUME",252:"FREQUENCY",253:"ADD.TOOLBAR",254:"DELETE.TOOLBAR",255:"User",256:"RESET.TOOLBAR",257:"EVALUATE",258:"GET.TOOLBAR",259:"GET.TOOL",260:"SPELLING.CHECK",261:"ERROR.TYPE",262:"APP.TITLE",263:"WINDOW.TITLE",264:"SAVE.TOOLBAR",265:"ENABLE.TOOL",266:"PRESS.TOOL",267:"REGISTER.ID",268:"GET.WORKBOOK",269:"AVEDEV",270:"BETADIST",271:"GAMMALN",272:"BETAINV",273:"BINOMDIST",274:"CHIDIST",275:"CHIINV",276:"COMBIN",277:"CONFIDENCE",278:"CRITBINOM",279:"EVEN",280:"EXPONDIST",281:"FDIST",282:"FINV",283:"FISHER",284:"FISHERINV",285:"FLOOR",286:"GAMMADIST",287:"GAMMAINV",288:"CEILING",289:"HYPGEOMDIST",290:"LOGNORMDIST",291:"LOGINV",292:"NEGBINOMDIST",293:"NORMDIST",294:"NORMSDIST",295:"NORMINV",296:"NORMSINV",297:"STANDARDIZE",298:"ODD",299:"PERMUT",300:"POISSON",301:"TDIST",302:"WEIBULL",303:"SUMXMY2",304:"SUMX2MY2",305:"SUMX2PY2",306:"CHITEST",307:"CORREL",308:"COVAR",309:"FORECAST",310:"FTEST",311:"INTERCEPT",312:"PEARSON",313:"RSQ",314:"STEYX",315:"SLOPE",316:"TTEST",317:"PROB",318:"DEVSQ",319:"GEOMEAN",320:"HARMEAN",321:"SUMSQ",322:"KURT",323:"SKEW",324:"ZTEST",325:"LARGE",326:"SMALL",327:"QUARTILE",328:"PERCENTILE",329:"PERCENTRANK",330:"MODE",331:"TRIMMEAN",332:"TINV",334:"MOVIE.COMMAND",335:"GET.MOVIE",336:"CONCATENATE",337:"POWER",338:"PIVOT.ADD.DATA",339:"GET.PIVOT.TABLE",340:"GET.PIVOT.FIELD",341:"GET.PIVOT.ITEM",342:"RADIANS",343:"DEGREES",344:"SUBTOTAL",345:"SUMIF",346:"COUNTIF",347:"COUNTBLANK",348:"SCENARIO.GET",349:"OPTIONS.LISTS.GET",350:"ISPMT",351:"DATEDIF",352:"DATESTRING",353:"NUMBERSTRING",354:"ROMAN",355:"OPEN.DIALOG",356:"SAVE.DIALOG",357:"VIEW.GET",358:"GETPIVOTDATA",359:"HYPERLINK",360:"PHONETIC",361:"AVERAGEA",362:"MAXA",363:"MINA",364:"STDEVPA",365:"VARPA",366:"STDEVA",367:"VARA",368:"BAHTTEXT",369:"THAIDAYOFWEEK",370:"THAIDIGIT",371:"THAIMONTHOFYEAR",372:"THAINUMSOUND",373:"THAINUMSTRING",374:"THAISTRINGLENGTH",375:"ISTHAIDIGIT",376:"ROUNDBAHTDOWN",377:"ROUNDBAHTUP",378:"THAIYEAR",379:"RTD",380:"CUBEVALUE",381:"CUBEMEMBER",382:"CUBEMEMBERPROPERTY",383:"CUBERANKEDMEMBER",384:"HEX2BIN",385:"HEX2DEC",386:"HEX2OCT",387:"DEC2BIN",388:"DEC2HEX",389:"DEC2OCT",390:"OCT2BIN",391:"OCT2HEX",392:"OCT2DEC",393:"BIN2DEC",394:"BIN2OCT",395:"BIN2HEX",396:"IMSUB",397:"IMDIV",398:"IMPOWER",399:"IMABS",400:"IMSQRT",401:"IMLN",402:"IMLOG2",403:"IMLOG10",404:"IMSIN",405:"IMCOS",406:"IMEXP",407:"IMARGUMENT",408:"IMCONJUGATE",409:"IMAGINARY",410:"IMREAL",411:"COMPLEX",412:"IMSUM",413:"IMPRODUCT",414:"SERIESSUM",415:"FACTDOUBLE",416:"SQRTPI",417:"QUOTIENT",418:"DELTA",419:"GESTEP",420:"ISEVEN",421:"ISODD",422:"MROUND",423:"ERF",424:"ERFC",425:"BESSELJ",426:"BESSELK",427:"BESSELY",428:"BESSELI",429:"XIRR",430:"XNPV",431:"PRICEMAT",432:"YIELDMAT",433:"INTRATE",434:"RECEIVED",435:"DISC",436:"PRICEDISC",437:"YIELDDISC",438:"TBILLEQ",439:"TBILLPRICE",440:"TBILLYIELD",441:"PRICE",442:"YIELD",443:"DOLLARDE",444:"DOLLARFR",445:"NOMINAL",446:"EFFECT",447:"CUMPRINC",448:"CUMIPMT",449:"EDATE",450:"EOMONTH",451:"YEARFRAC",452:"COUPDAYBS",453:"COUPDAYS",454:"COUPDAYSNC",455:"COUPNCD",456:"COUPNUM",457:"COUPPCD",458:"DURATION",459:"MDURATION",460:"ODDLPRICE",461:"ODDLYIELD",462:"ODDFPRICE",463:"ODDFYIELD",464:"RANDBETWEEN",465:"WEEKNUM",466:"AMORDEGRC",467:"AMORLINC",468:"CONVERT",724:"SHEETJS",469:"ACCRINT",470:"ACCRINTM",471:"WORKDAY",472:"NETWORKDAYS",473:"GCD",474:"MULTINOMIAL",475:"LCM",476:"FVSCHEDULE",477:"CUBEKPIMEMBER",478:"CUBESET",479:"CUBESETCOUNT",480:"IFERROR",481:"COUNTIFS",482:"SUMIFS",483:"AVERAGEIF",484:"AVERAGEIFS"},WQ={2:1,3:1,10:0,15:1,16:1,17:1,18:1,19:0,20:1,21:1,22:1,23:1,24:1,25:1,26:1,27:2,30:2,31:3,32:1,33:1,34:0,35:0,38:1,39:2,40:3,41:3,42:3,43:3,44:3,45:3,47:3,48:2,53:1,61:3,63:0,65:3,66:3,67:1,68:1,69:1,70:1,71:1,72:1,73:1,74:0,75:1,76:1,77:1,79:2,80:2,83:1,85:0,86:1,89:0,90:1,94:0,95:0,97:2,98:1,99:1,101:3,102:3,105:1,106:1,108:2,111:1,112:1,113:1,114:1,117:2,118:1,119:4,121:1,126:1,127:1,128:1,129:1,130:1,131:1,133:1,134:1,135:1,136:2,137:2,138:2,140:1,141:1,142:3,143:4,144:4,161:1,162:1,163:1,164:1,165:2,172:1,175:2,176:2,177:3,178:2,179:1,184:1,186:1,189:3,190:1,195:3,196:3,197:1,198:1,199:3,201:1,207:4,210:3,211:1,212:2,213:2,214:1,215:1,225:0,229:1,230:1,231:1,232:1,233:1,234:1,235:3,244:1,247:4,252:2,257:1,261:1,271:1,273:4,274:2,275:2,276:2,277:3,278:3,279:1,280:3,281:3,282:3,283:1,284:1,285:2,286:4,287:3,288:2,289:4,290:3,291:3,292:3,293:4,294:1,295:3,296:1,297:3,298:1,299:2,300:3,301:3,302:4,303:2,304:2,305:2,306:2,307:2,308:2,309:3,310:2,311:2,312:2,313:2,314:2,315:2,316:4,325:2,326:2,327:2,328:2,331:2,332:2,337:2,342:1,343:1,346:2,347:1,350:4,351:3,352:1,353:2,360:1,368:1,369:1,370:1,371:1,372:1,373:1,374:1,375:1,376:1,377:1,378:1,382:3,385:1,392:1,393:1,396:2,397:2,398:2,399:1,400:1,401:1,402:1,403:1,404:1,405:1,406:1,407:1,408:1,409:1,410:1,414:4,415:1,416:1,417:2,420:1,421:1,422:2,424:1,425:2,426:2,427:2,428:2,430:3,438:3,439:3,440:3,443:2,444:2,445:2,446:2,447:6,448:6,449:2,450:2,464:2,468:3,476:2,479:1,480:2,65535:0};function $Q(t){var e="of:="+t.replace(kb,"$1[.$2$3$4$5]").replace(/\]:\[/g,":");return e.replace(/;/g,"|").replace(/,/g,";")}function KQ(t){return t.replace(/\./,"!")}var Kc=typeof Map<"u";function Mb(t,e,n){var r=0,a=t.length;if(n){if(Kc?n.has(e):Object.prototype.hasOwnProperty.call(n,e)){for(var i=Kc?n.get(e):n[e];r-1?(n.width=P_(r),n.customWidth=1):e.width!=null&&(n.width=e.width),e.hidden&&(n.hidden=!0),e.level!=null&&(n.outlineLevel=n.level=e.level),n}function JO(t,e){if(t){var n=[.7,.7,.75,.75,.3,.3];t.left==null&&(t.left=n[0]),t.right==null&&(t.right=n[1]),t.top==null&&(t.top=n[2]),t.bottom==null&&(t.bottom=n[3]),t.header==null&&(t.header=n[4]),t.footer==null&&(t.footer=n[5])}}function Rs(t,e,n){var r=n.revssf[e.z!=null?e.z:"General"],a=60,i=t.length;if(r==null&&n.ssf){for(;a<392;++a)if(n.ssf[a]==null){GN(e.z,a),n.ssf[a]=e.z,n.revssf[e.z]=r=a;break}}for(a=0;a!=i;++a)if(t[a].numFmtId===r)return a;return t[i]={numFmtId:r,fontId:0,fillId:0,borderId:0,xfId:0,applyNumberFormat:1},i}function JQ(t,e,n){if(t&&t["!ref"]){var r=Ct(t["!ref"]);if(r.e.c',n=0;n!=t.length;++n)e+='';return e+""}function XQ(t,e,n,r,a){var i=!1,s={},o=null;if(r.bookType!=="xlsx"&&e.vbaraw){var l=e.SheetNames[n];try{e.Workbook&&(l=e.Workbook.Sheets[n].CodeName||l)}catch{}i=!0,s.codeName=Vd(ct(l))}if(t&&t["!outline"]){var u={summaryBelow:1,summaryRight:1};t["!outline"].above&&(u.summaryBelow=0),t["!outline"].left&&(u.summaryRight=0),o=(o||"")+de("outlinePr",null,u)}!i&&!o||(a[a.length]=de("sheetPr",o,s))}var QQ=["objects","scenarios","selectLockedCells","selectUnlockedCells"],ZQ=["formatColumns","formatRows","formatCells","insertColumns","insertRows","insertHyperlinks","deleteColumns","deleteRows","sort","autoFilter","pivotTables"];function eZ(t){var e={sheet:1};return QQ.forEach(function(n){t[n]!=null&&t[n]&&(e[n]="1")}),ZQ.forEach(function(n){t[n]!=null&&!t[n]&&(e[n]="0")}),t.password&&(e.password=NO(t.password).toString(16).toUpperCase()),de("sheetProtection",null,e)}function tZ(t){return JO(t),de("pageMargins",null,t)}function nZ(t,e){for(var n=[""],r,a=0;a!=e.length;++a)(r=e[a])&&(n[n.length]=de("col",null,qm(a,r)));return n[n.length]="",n.join("")}function rZ(t,e,n,r){var a=typeof t.ref=="string"?t.ref:Kt(t.ref);n.Workbook||(n.Workbook={Sheets:[]}),n.Workbook.Names||(n.Workbook.Names=[]);var i=n.Workbook.Names,s=Rr(a);s.s.r==s.e.r&&(s.e.r=Rr(e["!ref"]).e.r,a=Kt(s));for(var o=0;o"u"&&(t.z=Bt[14]);break;default:a=t.v;break}var o=Sn("v",ct(a)),l={r:e},u=Rs(r.cellXfs,t,r);switch(u!==0&&(l.s=u),t.t){case"n":break;case"d":l.t="d";break;case"b":l.t="b";break;case"e":l.t="e";break;case"z":break;default:if(t.v==null){delete t.t;break}if(t.v.length>32767)throw new Error("Text length must not exceed 32767 characters");if(r&&r.bookSST){o=Sn("v",""+Mb(r.Strings,t.v,r.revStrings)),l.t="s";break}l.t="str";break}if(t.t!=i&&(t.t=i,t.v=s),typeof t.f=="string"&&t.f){var c=t.F&&t.F.slice(0,e.length)==e?{t:"array",ref:t.F}:null;o=de("f",ct(t.f),c)+(t.v!=null?o:"")}return t.l&&n["!links"].push([e,t.l]),t.D&&(l.cm=1),de("c",o,l)}function sZ(t,e,n,r){var a=[],i=[],s=Ct(t["!ref"]),o="",l,u="",c=[],h=0,f=0,p=t["!rows"],g=Array.isArray(t),m={r:u},_,x=-1;for(f=s.s.c;f<=s.e.c;++f)c[f]=Un(f);for(h=s.s.r;h<=s.e.r;++h){for(i=[],u=Cn(h),f=s.s.c;f<=s.e.c;++f){l=c[f]+u;var E=g?(t[h]||[])[f]:t[l];E!==void 0&&(o=iZ(E,l,t,e))!=null&&i.push(o)}(i.length>0||p&&p[h])&&(m={r:u},p&&p[h]&&(_=p[h],_.hidden&&(m.hidden=1),x=-1,_.hpx?x=y0(_.hpx):_.hpt&&(x=_.hpt),x>-1&&(m.ht=x,m.customHeight=1),_.level&&(m.outlineLevel=_.level)),a[a.length]=de("row",i.join(""),m))}if(p)for(;h-1&&(m.ht=x,m.customHeight=1),_.level&&(m.outlineLevel=_.level),a[a.length]=de("row","",m));return a.join("")}function YO(t,e,n,r){var a=[Yt,de("worksheet",null,{xmlns:Iu[0],"xmlns:r":cn.r})],i=n.SheetNames[t],s=0,o="",l=n.Sheets[i];l==null&&(l={});var u=l["!ref"]||"A1",c=Ct(u);if(c.e.c>16383||c.e.r>1048575){if(e.WTF)throw new Error("Range "+u+" exceeds format limit A1:XFD1048576");c.e.c=Math.min(c.e.c,16383),c.e.r=Math.min(c.e.c,1048575),u=Kt(c)}r||(r={}),l["!comments"]=[];var h=[];XQ(l,n,t,e,a),a[a.length]=de("dimension",null,{ref:u}),a[a.length]=aZ(l,e,t,n),e.sheetFormat&&(a[a.length]=de("sheetFormatPr",null,{defaultRowHeight:e.sheetFormat.defaultRowHeight||"16",baseColWidth:e.sheetFormat.baseColWidth||"10",outlineLevelRow:e.sheetFormat.outlineLevelRow||"7"})),l["!cols"]!=null&&l["!cols"].length>0&&(a[a.length]=nZ(l,l["!cols"])),a[s=a.length]="",l["!links"]=[],l["!ref"]!=null&&(o=sZ(l,e),o.length>0&&(a[a.length]=o)),a.length>s+1&&(a[a.length]="",a[s]=a[s].replace("/>",">")),l["!protect"]&&(a[a.length]=eZ(l["!protect"])),l["!autofilter"]!=null&&(a[a.length]=rZ(l["!autofilter"],l,n,t)),l["!merges"]!=null&&l["!merges"].length>0&&(a[a.length]=YQ(l["!merges"]));var f=-1,p,g=-1;return l["!links"].length>0&&(a[a.length]="",l["!links"].forEach(function(m){m[1].Target&&(p={ref:m[0]},m[1].Target.charAt(0)!="#"&&(g=ut(r,-1,ct(m[1].Target).replace(/#.*$/,""),rt.HLINK),p["r:id"]="rId"+g),(f=m[1].Target.indexOf("#"))>-1&&(p.location=ct(m[1].Target.slice(f+1))),m[1].Tooltip&&(p.tooltip=ct(m[1].Tooltip)),a[a.length]=de("hyperlink",null,p))}),a[a.length]=""),delete l["!links"],l["!margins"]!=null&&(a[a.length]=tZ(l["!margins"])),(!e||e.ignoreEC||e.ignoreEC==null)&&(a[a.length]=Sn("ignoredErrors",de("ignoredError",null,{numberStoredAsText:1,sqref:u}))),h.length>0&&(g=ut(r,-1,"../drawings/drawing"+(t+1)+".xml",rt.DRAW),a[a.length]=de("drawing",null,{"r:id":"rId"+g}),l["!drawing"]=h),l["!comments"].length>0&&(g=ut(r,-1,"../drawings/vmlDrawing"+(t+1)+".vml",rt.VML),a[a.length]=de("legacyDrawing",null,{"r:id":"rId"+g}),l["!legacy"]=g),a.length>1&&(a[a.length]="",a[1]=a[1].replace("/>",">")),a.join("")}function oZ(t,e){var n={},r=t.l+e;n.r=t.read_shift(4),t.l+=4;var a=t.read_shift(2);t.l+=1;var i=t.read_shift(1);return t.l=r,i&7&&(n.level=i&7),i&16&&(n.hidden=!0),i&32&&(n.hpt=a/20),n}function lZ(t,e,n){var r=ne(145),a=(n["!rows"]||[])[t]||{};r.write_shift(4,t),r.write_shift(4,0);var i=320;a.hpx?i=y0(a.hpx)*20:a.hpt&&(i=a.hpt*20),r.write_shift(2,i),r.write_shift(1,0);var s=0;a.level&&(s|=a.level),a.hidden&&(s|=16),(a.hpx||a.hpt)&&(s|=32),r.write_shift(1,s),r.write_shift(1,0);var o=0,l=r.l;r.l+=4;for(var u={r:t,c:0},c=0;c<16;++c)if(!(e.s.c>c+1<<10||e.e.cr.l?r.slice(0,r.l):r}function uZ(t,e,n,r){var a=lZ(r,n,e);(a.length>17||(e["!rows"]||[])[r])&&ae(t,0,a)}var cZ=qo,dZ=Ru;function hZ(){}function fZ(t,e){var n={},r=t[t.l];return++t.l,n.above=!(r&64),n.left=!(r&128),t.l+=18,n.name=SJ(t),n}function pZ(t,e,n){n==null&&(n=ne(84+4*t.length));var r=192;e&&(e.above&&(r&=-65),e.left&&(r&=-129)),n.write_shift(1,r);for(var a=1;a<3;++a)n.write_shift(1,0);return m0({auto:1},n),n.write_shift(-4,-1),n.write_shift(-4,-1),dO(t,n),n.slice(0,n.l)}function mZ(t){var e=Gr(t);return[e]}function gZ(t,e,n){return n==null&&(n=ne(8)),Vo(e,n)}function vZ(t){var e=jo(t);return[e]}function _Z(t,e,n){return n==null&&(n=ne(4)),zo(e,n)}function yZ(t){var e=Gr(t),n=t.read_shift(1);return[e,n,"b"]}function EZ(t,e,n){return n==null&&(n=ne(9)),Vo(e,n),n.write_shift(1,t.v?1:0),n}function bZ(t){var e=jo(t),n=t.read_shift(1);return[e,n,"b"]}function xZ(t,e,n){return n==null&&(n=ne(5)),zo(e,n),n.write_shift(1,t.v?1:0),n}function SZ(t){var e=Gr(t),n=t.read_shift(1);return[e,n,"e"]}function TZ(t,e,n){return n==null&&(n=ne(9)),Vo(e,n),n.write_shift(1,t.v),n}function wZ(t){var e=jo(t),n=t.read_shift(1);return[e,n,"e"]}function CZ(t,e,n){return n==null&&(n=ne(8)),zo(e,n),n.write_shift(1,t.v),n.write_shift(2,0),n.write_shift(1,0),n}function AZ(t){var e=Gr(t),n=t.read_shift(4);return[e,n,"s"]}function IZ(t,e,n){return n==null&&(n=ne(12)),Vo(e,n),n.write_shift(4,e.v),n}function PZ(t){var e=jo(t),n=t.read_shift(4);return[e,n,"s"]}function RZ(t,e,n){return n==null&&(n=ne(8)),zo(e,n),n.write_shift(4,e.v),n}function kZ(t){var e=Gr(t),n=ku(t);return[e,n,"n"]}function NZ(t,e,n){return n==null&&(n=ne(16)),Vo(e,n),Po(t.v,n),n}function OZ(t){var e=jo(t),n=ku(t);return[e,n,"n"]}function MZ(t,e,n){return n==null&&(n=ne(12)),zo(e,n),Po(t.v,n),n}function LZ(t){var e=Gr(t),n=hO(t);return[e,n,"n"]}function DZ(t,e,n){return n==null&&(n=ne(12)),Vo(e,n),fO(t.v,n),n}function FZ(t){var e=jo(t),n=hO(t);return[e,n,"n"]}function BZ(t,e,n){return n==null&&(n=ne(8)),zo(e,n),fO(t.v,n),n}function UZ(t){var e=Gr(t),n=Cb(t);return[e,n,"is"]}function VZ(t){var e=Gr(t),n=Vn(t);return[e,n,"str"]}function jZ(t,e,n){return n==null&&(n=ne(12+4*t.v.length)),Vo(e,n),hn(t.v,n),n.length>n.l?n.slice(0,n.l):n}function zZ(t){var e=jo(t),n=Vn(t);return[e,n,"str"]}function qZ(t,e,n){return n==null&&(n=ne(8+4*t.v.length)),zo(e,n),hn(t.v,n),n.length>n.l?n.slice(0,n.l):n}function GZ(t,e,n){var r=t.l+e,a=Gr(t);a.r=n["!row"];var i=t.read_shift(1),s=[a,i,"b"];if(n.cellFormula){t.l+=2;var o=zm(t,r-t.l,n);s[3]=uu(o,null,a,n.supbooks,n)}else t.l=r;return s}function HZ(t,e,n){var r=t.l+e,a=Gr(t);a.r=n["!row"];var i=t.read_shift(1),s=[a,i,"e"];if(n.cellFormula){t.l+=2;var o=zm(t,r-t.l,n);s[3]=uu(o,null,a,n.supbooks,n)}else t.l=r;return s}function WZ(t,e,n){var r=t.l+e,a=Gr(t);a.r=n["!row"];var i=ku(t),s=[a,i,"n"];if(n.cellFormula){t.l+=2;var o=zm(t,r-t.l,n);s[3]=uu(o,null,a,n.supbooks,n)}else t.l=r;return s}function $Z(t,e,n){var r=t.l+e,a=Gr(t);a.r=n["!row"];var i=Vn(t),s=[a,i,"str"];if(n.cellFormula){t.l+=2;var o=zm(t,r-t.l,n);s[3]=uu(o,null,a,n.supbooks,n)}else t.l=r;return s}var KZ=qo,JZ=Ru;function YZ(t,e){return e==null&&(e=ne(4)),e.write_shift(4,t),e}function XZ(t,e){var n=t.l+e,r=qo(t),a=Ab(t),i=Vn(t),s=Vn(t),o=Vn(t);t.l=n;var l={rfx:r,relId:a,loc:i,display:o};return s&&(l.Tooltip=s),l}function QZ(t,e){var n=ne(50+4*(t[1].Target.length+(t[1].Tooltip||"").length));Ru({s:dn(t[0]),e:dn(t[0])},n),Ib("rId"+e,n);var r=t[1].Target.indexOf("#"),a=r==-1?"":t[1].Target.slice(r+1);return hn(a||"",n),hn(t[1].Tooltip||"",n),hn("",n),n.slice(0,n.l)}function ZZ(){}function eee(t,e,n){var r=t.l+e,a=pO(t),i=t.read_shift(1),s=[a];if(s[2]=i,n.cellFormula){var o=zQ(t,r-t.l,n);s[1]=o}else t.l=r;return s}function tee(t,e,n){var r=t.l+e,a=qo(t),i=[a];if(n.cellFormula){var s=GQ(t,r-t.l,n);i[1]=s,t.l=r}else t.l=r;return i}function nee(t,e,n){n==null&&(n=ne(18));var r=qm(t,e);n.write_shift(-4,t),n.write_shift(-4,t),n.write_shift(4,(r.width||10)*256),n.write_shift(4,0);var a=0;return e.hidden&&(a|=1),typeof r.width=="number"&&(a|=2),e.level&&(a|=e.level<<8),n.write_shift(2,a),n}var XO=["left","right","top","bottom","header","footer"];function ree(t){var e={};return XO.forEach(function(n){e[n]=ku(t)}),e}function aee(t,e){return e==null&&(e=ne(6*8)),JO(t),XO.forEach(function(n){Po(t[n],e)}),e}function iee(t){var e=t.read_shift(2);return t.l+=28,{RTL:e&32}}function see(t,e,n){n==null&&(n=ne(30));var r=924;return(((e||{}).Views||[])[0]||{}).RTL&&(r|=32),n.write_shift(2,r),n.write_shift(4,0),n.write_shift(4,0),n.write_shift(4,0),n.write_shift(1,0),n.write_shift(1,0),n.write_shift(2,0),n.write_shift(2,100),n.write_shift(2,0),n.write_shift(2,0),n.write_shift(2,0),n.write_shift(4,0),n}function oee(t){var e=ne(24);return e.write_shift(4,4),e.write_shift(4,1),Ru(t,e),e}function lee(t,e){return e==null&&(e=ne(16*4+2)),e.write_shift(2,t.password?NO(t.password):0),e.write_shift(4,1),[["objects",!1],["scenarios",!1],["formatCells",!0],["formatColumns",!0],["formatRows",!0],["insertColumns",!0],["insertRows",!0],["insertHyperlinks",!0],["deleteColumns",!0],["deleteRows",!0],["selectLockedCells",!1],["sort",!0],["autoFilter",!0],["pivotTables",!0],["selectUnlockedCells",!1]].forEach(function(n){n[1]?e.write_shift(4,t[n[0]]!=null&&!t[n[0]]?1:0):e.write_shift(4,t[n[0]]!=null&&t[n[0]]?0:1)}),e}function uee(){}function cee(){}function dee(t,e,n,r,a,i,s){if(e.v===void 0)return!1;var o="";switch(e.t){case"b":o=e.v?"1":"0";break;case"d":e=hr(e),e.z=e.z||Bt[14],e.v=dr(Yn(e.v)),e.t="n";break;case"n":case"e":o=""+e.v;break;default:o=e.v;break}var l={r:n,c:r};switch(l.s=Rs(a.cellXfs,e,a),e.l&&i["!links"].push([ht(l),e.l]),e.c&&i["!comments"].push([ht(l),e.c]),e.t){case"s":case"str":return a.bookSST?(o=Mb(a.Strings,e.v,a.revStrings),l.t="s",l.v=o,s?ae(t,18,RZ(e,l)):ae(t,7,IZ(e,l))):(l.t="str",s?ae(t,17,qZ(e,l)):ae(t,6,jZ(e,l))),!0;case"n":return e.v==(e.v|0)&&e.v>-1e3&&e.v<1e3?s?ae(t,13,BZ(e,l)):ae(t,2,DZ(e,l)):s?ae(t,16,MZ(e,l)):ae(t,5,NZ(e,l)),!0;case"b":return l.t="b",s?ae(t,15,xZ(e,l)):ae(t,4,EZ(e,l)),!0;case"e":return l.t="e",s?ae(t,14,CZ(e,l)):ae(t,3,TZ(e,l)),!0}return s?ae(t,12,_Z(e,l)):ae(t,1,gZ(e,l)),!0}function hee(t,e,n,r){var a=Ct(e["!ref"]||"A1"),i,s="",o=[];ae(t,145);var l=Array.isArray(e),u=a.e.r;e["!rows"]&&(u=Math.max(a.e.r,e["!rows"].length-1));for(var c=a.s.r;c<=u;++c){s=Cn(c),uZ(t,e,a,c);var h=!1;if(c<=a.e.r)for(var f=a.s.c;f<=a.e.c;++f){c===a.s.r&&(o[f]=Un(f)),i=o[f]+s;var p=l?(e[c]||[])[f]:e[i];if(!p){h=!1;continue}h=dee(t,p,c,f,r,e,h)}}ae(t,146)}function fee(t,e){!e||!e["!merges"]||(ae(t,177,YZ(e["!merges"].length)),e["!merges"].forEach(function(n){ae(t,176,JZ(n))}),ae(t,178))}function pee(t,e){!e||!e["!cols"]||(ae(t,390),e["!cols"].forEach(function(n,r){n&&ae(t,60,nee(r,n))}),ae(t,391))}function mee(t,e){!e||!e["!ref"]||(ae(t,648),ae(t,649,oee(Ct(e["!ref"]))),ae(t,650))}function gee(t,e,n){e["!links"].forEach(function(r){if(r[1].Target){var a=ut(n,-1,r[1].Target.replace(/#.*$/,""),rt.HLINK);ae(t,494,QZ(r,a))}}),delete e["!links"]}function vee(t,e,n,r){if(e["!comments"].length>0){var a=ut(r,-1,"../drawings/vmlDrawing"+(n+1)+".vml",rt.VML);ae(t,551,Ib("rId"+a)),e["!legacy"]=a}}function _ee(t,e,n,r){if(e["!autofilter"]){var a=e["!autofilter"],i=typeof a.ref=="string"?a.ref:Kt(a.ref);n.Workbook||(n.Workbook={Sheets:[]}),n.Workbook.Names||(n.Workbook.Names=[]);var s=n.Workbook.Names,o=Rr(i);o.s.r==o.e.r&&(o.e.r=Rr(e["!ref"]).e.r,i=Kt(o));for(var l=0;l16383||l.e.r>1048575){if(e.WTF)throw new Error("Range "+(s["!ref"]||"A1")+" exceeds format limit A1:XFD1048576");l.e.c=Math.min(l.e.c,16383),l.e.r=Math.min(l.e.c,1048575)}return s["!links"]=[],s["!comments"]=[],ae(a,129),(n.vbaraw||s["!outline"])&&ae(a,147,pZ(o,s["!outline"])),ae(a,148,dZ(l)),yee(a,s,n.Workbook),pee(a,s),hee(a,s,t,e),Eee(a,s),_ee(a,s,n,t),fee(a,s),gee(a,s,r),s["!margins"]&&ae(a,476,aee(s["!margins"])),(!e||e.ignoreEC||e.ignoreEC==null)&&mee(a,s),vee(a,s,t,r),ae(a,130),a.end()}function xee(t,e){t.l+=10;var n=Vn(t);return{name:n}}var See=[["allowRefreshQuery",!1,"bool"],["autoCompressPictures",!0,"bool"],["backupFile",!1,"bool"],["checkCompatibility",!1,"bool"],["CodeName",""],["date1904",!1,"bool"],["defaultThemeVersion",0,"int"],["filterPrivacy",!1,"bool"],["hidePivotFieldList",!1,"bool"],["promptedSolutions",!1,"bool"],["publishItems",!1,"bool"],["refreshAllConnections",!1,"bool"],["saveExternalLinkValues",!0,"bool"],["showBorderUnselectedTables",!0,"bool"],["showInkAnnotation",!0,"bool"],["showObjects","all"],["showPivotChartFilter",!1,"bool"],["updateLinks","userSet"]];function Tee(t){return!t.Workbook||!t.Workbook.WBProps?"false":tJ(t.Workbook.WBProps.date1904)?"true":"false"}var wee="][*?/\\".split("");function QO(t,e){if(t.length>31)throw new Error("Sheet names cannot exceed 31 chars");var n=!0;return wee.forEach(function(r){if(t.indexOf(r)!=-1)throw new Error("Sheet name cannot contain : \\ / ? * [ ]")}),n}function Cee(t,e,n){t.forEach(function(r,a){QO(r);for(var i=0;i22)throw new Error("Bad Code Name: Worksheet"+s)}})}function Aee(t){if(!t||!t.SheetNames||!t.Sheets)throw new Error("Invalid Workbook");if(!t.SheetNames.length)throw new Error("Workbook is empty");var e=t.Workbook&&t.Workbook.Sheets||[];Cee(t.SheetNames,e,!!t.vbaraw);for(var n=0;n0,r={codeName:"ThisWorkbook"};t.Workbook&&t.Workbook.WBProps&&(See.forEach(function(o){t.Workbook.WBProps[o[0]]!=null&&t.Workbook.WBProps[o[0]]!=o[1]&&(r[o[0]]=t.Workbook.WBProps[o[0]])}),t.Workbook.WBProps.CodeName&&(r.codeName=t.Workbook.WBProps.CodeName,delete r.CodeName)),e[e.length]=de("workbookPr",null,r);var a=t.Workbook&&t.Workbook.Sheets||[],i=0;if(a&&a[0]&&a[0].Hidden){for(e[e.length]="",i=0;i!=t.SheetNames.length&&!(!a[i]||!a[i].Hidden);++i);i==t.SheetNames.length&&(i=0),e[e.length]='',e[e.length]=""}for(e[e.length]="",i=0;i!=t.SheetNames.length;++i){var s={name:ct(t.SheetNames[i].slice(0,31))};if(s.sheetId=""+(i+1),s["r:id"]="rId"+(i+1),a[i])switch(a[i].Hidden){case 1:s.state="hidden";break;case 2:s.state="veryHidden";break}e[e.length]=de("sheet",null,s)}return e[e.length]="",n&&(e[e.length]="",t.Workbook&&t.Workbook.Names&&t.Workbook.Names.forEach(function(o){var l={name:o.Name};o.Comment&&(l.comment=o.Comment),o.Sheet!=null&&(l.localSheetId=""+o.Sheet),o.Hidden&&(l.hidden="1"),o.Ref&&(e[e.length]=de("definedName",ct(o.Ref),l))}),e[e.length]=""),e.length>2&&(e[e.length]="",e[1]=e[1].replace("/>",">")),e.join("")}function Iee(t,e){var n={};return n.Hidden=t.read_shift(4),n.iTabID=t.read_shift(4),n.strRelID=I_(t),n.name=Vn(t),n}function Pee(t,e){return e||(e=ne(127)),e.write_shift(4,t.Hidden),e.write_shift(4,t.iTabID),Ib(t.strRelID,e),hn(t.name.slice(0,31),e),e.length>e.l?e.slice(0,e.l):e}function Ree(t,e){var n={},r=t.read_shift(4);n.defaultThemeVersion=t.read_shift(4);var a=e>8?Vn(t):"";return a.length>0&&(n.CodeName=a),n.autoCompressPictures=!!(r&65536),n.backupFile=!!(r&64),n.checkCompatibility=!!(r&4096),n.date1904=!!(r&1),n.filterPrivacy=!!(r&8),n.hidePivotFieldList=!!(r&1024),n.promptedSolutions=!!(r&16),n.publishItems=!!(r&2048),n.refreshAllConnections=!!(r&262144),n.saveExternalLinkValues=!!(r&128),n.showBorderUnselectedTables=!!(r&4),n.showInkAnnotation=!!(r&32),n.showObjects=["all","placeholders","none"][r>>13&3],n.showPivotChartFilter=!!(r&32768),n.updateLinks=["userSet","never","always"][r>>8&3],n}function kee(t,e){e||(e=ne(72));var n=0;return t&&t.filterPrivacy&&(n|=8),e.write_shift(4,n),e.write_shift(4,0),dO(t&&t.CodeName||"ThisWorkbook",e),e.slice(0,e.l)}function Nee(t,e,n){var r=t.l+e;t.l+=4,t.l+=1;var a=t.read_shift(4),i=TJ(t),s=qQ(t,0,n),o=Ab(t);t.l=r;var l={Name:i,Ptg:s};return a<268435455&&(l.Sheet=a),o&&(l.Comment=o),l}function Oee(t,e){ae(t,143);for(var n=0;n!=e.SheetNames.length;++n){var r=e.Workbook&&e.Workbook.Sheets&&e.Workbook.Sheets[n]&&e.Workbook.Sheets[n].Hidden||0,a={Hidden:r,iTabID:n+1,strRelID:"rId"+(n+1),name:e.SheetNames[n]};ae(t,156,Pee(a))}ae(t,144)}function Mee(t,e){e||(e=ne(127));for(var n=0;n!=4;++n)e.write_shift(4,0);return hn("SheetJS",e),hn(l0.version,e),hn(l0.version,e),hn("7262",e),e.length>e.l?e.slice(0,e.l):e}function Lee(t,e){e||(e=ne(29)),e.write_shift(-4,0),e.write_shift(-4,460),e.write_shift(4,28800),e.write_shift(4,17600),e.write_shift(4,500),e.write_shift(4,t),e.write_shift(4,t);var n=120;return e.write_shift(1,n),e.length>e.l?e.slice(0,e.l):e}function Dee(t,e){if(!(!e.Workbook||!e.Workbook.Sheets)){for(var n=e.Workbook.Sheets,r=0,a=-1,i=-1;ra||(ae(t,135),ae(t,158,Lee(a)),ae(t,136))}}function Fee(t,e){var n=ur();return ae(n,131),ae(n,128,Mee()),ae(n,153,kee(t.Workbook&&t.Workbook.WBProps||null)),Dee(n,t),Oee(n,t),ae(n,132),n.end()}function Bee(t,e,n){return(e.slice(-4)===".bin"?Fee:ZO)(t)}function Uee(t,e,n,r,a){return(e.slice(-4)===".bin"?bee:YO)(t,n,r,a)}function Vee(t,e,n){return(e.slice(-4)===".bin"?aX:LO)(t,n)}function jee(t,e,n){return(e.slice(-4)===".bin"?kY:kO)(t,n)}function zee(t,e,n){return(e.slice(-4)===".bin"?EX:VO)(t)}function qee(t){return(t.slice(-4)===".bin"?hX:BO)()}function Gee(t,e){var n=[];return t.Props&&n.push(VJ(t.Props,e)),t.Custprops&&n.push(jJ(t.Props,t.Custprops)),n.join("")}function Hee(){return""}function Wee(t,e){var n=[''];return e.cellXfs.forEach(function(r,a){var i=[];i.push(de("NumberFormat",null,{"ss:Format":ct(Bt[r.numFmtId])}));var s={"ss:ID":"s"+(21+a)};n.push(de("Style",i.join(""),s))}),de("Styles",n.join(""))}function e3(t){return de("NamedRange",null,{"ss:Name":t.Name,"ss:RefersTo":"="+Nb(t.Ref,{r:0,c:0})})}function $ee(t){if(!((t||{}).Workbook||{}).Names)return"";for(var e=t.Workbook.Names,n=[],r=0;r"),t["!margins"].header&&a.push(de("Header",null,{"x:Margin":t["!margins"].header})),t["!margins"].footer&&a.push(de("Footer",null,{"x:Margin":t["!margins"].footer})),a.push(de("PageMargins",null,{"x:Bottom":t["!margins"].bottom||"0.75","x:Left":t["!margins"].left||"0.7","x:Right":t["!margins"].right||"0.7","x:Top":t["!margins"].top||"0.75"})),a.push("")),r&&r.Workbook&&r.Workbook.Sheets&&r.Workbook.Sheets[n])if(r.Workbook.Sheets[n].Hidden)a.push(de("Visible",r.Workbook.Sheets[n].Hidden==1?"SheetHidden":"SheetVeryHidden",{}));else{for(var i=0;i")}return((((r||{}).Workbook||{}).Views||[])[0]||{}).RTL&&a.push(""),t["!protect"]&&(a.push(Sn("ProtectContents","True")),t["!protect"].objects&&a.push(Sn("ProtectObjects","True")),t["!protect"].scenarios&&a.push(Sn("ProtectScenarios","True")),t["!protect"].selectLockedCells!=null&&!t["!protect"].selectLockedCells?a.push(Sn("EnableSelection","NoSelection")):t["!protect"].selectUnlockedCells!=null&&!t["!protect"].selectUnlockedCells&&a.push(Sn("EnableSelection","UnlockedCells")),[["formatCells","AllowFormatCells"],["formatColumns","AllowSizeCols"],["formatRows","AllowSizeRows"],["insertColumns","AllowInsertCols"],["insertRows","AllowInsertRows"],["insertHyperlinks","AllowInsertHyperlinks"],["deleteColumns","AllowDeleteCols"],["deleteRows","AllowDeleteRows"],["sort","AllowSort"],["autoFilter","AllowFilter"],["pivotTables","AllowUsePivotTables"]].forEach(function(s){t["!protect"][s[0]]&&a.push("<"+s[1]+"/>")})),a.length==0?"":de("WorksheetOptions",a.join(""),{xmlns:Er.x})}function Yee(t){return t.map(function(e){var n=eJ(e.t||""),r=de("ss:Data",n,{xmlns:"http://www.w3.org/TR/REC-html40"});return de("Comment",r,{"ss:Author":e.a})}).join("")}function Xee(t,e,n,r,a,i,s){if(!t||t.v==null&&t.f==null)return"";var o={};if(t.f&&(o["ss:Formula"]="="+ct(Nb(t.f,s))),t.F&&t.F.slice(0,e.length)==e){var l=dn(t.F.slice(e.length+1));o["ss:ArrayRange"]="RC:R"+(l.r==s.r?"":"["+(l.r-s.r)+"]")+"C"+(l.c==s.c?"":"["+(l.c-s.c)+"]")}if(t.l&&t.l.Target&&(o["ss:HRef"]=ct(t.l.Target),t.l.Tooltip&&(o["x:HRefScreenTip"]=ct(t.l.Tooltip))),n["!merges"])for(var u=n["!merges"],c=0;c!=u.length;++c)u[c].s.c!=s.c||u[c].s.r!=s.r||(u[c].e.c>u[c].s.c&&(o["ss:MergeAcross"]=u[c].e.c-u[c].s.c),u[c].e.r>u[c].s.r&&(o["ss:MergeDown"]=u[c].e.r-u[c].s.r));var h="",f="";switch(t.t){case"z":if(!r.sheetStubs)return"";break;case"n":h="Number",f=String(t.v);break;case"b":h="Boolean",f=t.v?"1":"0";break;case"e":h="Error",f=Sh[t.v];break;case"d":h="DateTime",f=new Date(t.v).toISOString(),t.z==null&&(t.z=t.z||Bt[14]);break;case"s":h="String",f=ZK(t.v||"");break}var p=Rs(r.cellXfs,t,r);o["ss:StyleID"]="s"+(21+p),o["ss:Index"]=s.c+1;var g=t.v!=null?f:"",m=t.t=="z"?"":''+g+"";return(t.c||[]).length>0&&(m+=Yee(t.c)),de("Cell",m,o)}function Qee(t,e){var n='"}function Zee(t,e,n,r){if(!t["!ref"])return"";var a=Ct(t["!ref"]),i=t["!merges"]||[],s=0,o=[];t["!cols"]&&t["!cols"].forEach(function(_,x){Rb(_);var E=!!_.width,y=qm(x,_),I={"ss:Index":x+1};E&&(I["ss:Width"]=v0(y.width)),_.hidden&&(I["ss:Hidden"]="1"),o.push(de("Column",null,I))});for(var l=Array.isArray(t),u=a.s.r;u<=a.e.r;++u){for(var c=[Qee(u,(t["!rows"]||[])[u])],h=a.s.c;h<=a.e.c;++h){var f=!1;for(s=0;s!=i.length;++s)if(!(i[s].s.c>h)&&!(i[s].s.r>u)&&!(i[s].e.c"),c.length>2&&o.push(c.join(""))}return o.join("")}function ete(t,e,n){var r=[],a=n.SheetNames[t],i=n.Sheets[a],s=i?Kee(i,e,t,n):"";return s.length>0&&r.push(""+s+""),s=i?Zee(i,e,t,n):"",s.length>0&&r.push(""+s+"
"),r.push(Jee(i,e,t,n)),r.join("")}function tte(t,e){e||(e={}),t.SSF||(t.SSF=hr(Bt)),t.SSF&&(Bm(),Fm(t.SSF),e.revssf=Um(t.SSF),e.revssf[t.SSF[65535]]=0,e.ssf=t.SSF,e.cellXfs=[],Rs(e.cellXfs,{},{revssf:{General:0}}));var n=[];n.push(Gee(t,e)),n.push(Hee()),n.push(""),n.push("");for(var r=0;r-1||bO.indexOf(a[i][0])>-1||a[i][1]!=null&&u.push(a[i]);r.length&&pt.utils.cfb_add(e,"/SummaryInformation",Z2(r,hv.SI,l,K2)),(n.length||u.length)&&pt.utils.cfb_add(e,"/DocumentSummaryInformation",Z2(n,hv.DSI,o,$2,u.length?u:null,hv.UDI))}function rte(t,e){var n=e||{},r=pt.utils.cfb_new({root:"R"}),a="/Workbook";switch(n.bookType||"xls"){case"xls":n.bookType="biff8";case"xla":n.bookType||(n.bookType="xla");case"biff8":a="/Workbook",n.biff=8;break;case"biff5":a="/Book",n.biff=5;break;default:throw new Error("invalid type "+n.bookType+" for XLS CFB")}return pt.utils.cfb_add(r,a,t3(t,n)),n.biff==8&&(t.Props||t.Custprops)&&nte(t,r),n.biff==8&&t.vbaraw&&bX(r,pt.read(t.vbaraw,{type:typeof t.vbaraw=="string"?"binary":"buffer"})),r}var ate={0:{f:oZ},1:{f:mZ},2:{f:LZ},3:{f:SZ},4:{f:yZ},5:{f:kZ},6:{f:VZ},7:{f:AZ},8:{f:$Z},9:{f:WZ},10:{f:GZ},11:{f:HZ},12:{f:vZ},13:{f:FZ},14:{f:wZ},15:{f:bZ},16:{f:OZ},17:{f:zZ},18:{f:PZ},19:{f:Cb},20:{},21:{},22:{},23:{},24:{},25:{},26:{},27:{},28:{},29:{},30:{},31:{},32:{},33:{},34:{},35:{T:1},36:{T:-1},37:{T:1},38:{T:-1},39:{f:Nee},40:{},42:{},43:{f:VY},44:{f:BY},45:{f:qY},46:{f:HY},47:{f:GY},48:{},49:{f:vJ},50:{},51:{f:oX},52:{T:1},53:{T:-1},54:{T:1},55:{T:-1},56:{T:1},57:{T:-1},58:{},59:{},60:{f:_Y},62:{f:UZ},63:{f:fX},64:{f:uee},65:{},66:{},67:{},68:{},69:{},70:{},128:{},129:{T:1},130:{T:-1},131:{T:1,f:Ma,p:0},132:{T:-1},133:{T:1},134:{T:-1},135:{T:1},136:{T:-1},137:{T:1,f:iee},138:{T:-1},139:{T:1},140:{T:-1},141:{T:1},142:{T:-1},143:{T:1},144:{T:-1},145:{T:1},146:{T:-1},147:{f:fZ},148:{f:cZ,p:16},151:{f:ZZ},152:{},153:{f:Ree},154:{},155:{},156:{f:Iee},157:{},158:{},159:{T:1,f:IY},160:{T:-1},161:{T:1,f:qo},162:{T:-1},163:{T:1},164:{T:-1},165:{T:1},166:{T:-1},167:{},168:{},169:{},170:{},171:{},172:{T:1},173:{T:-1},174:{},175:{},176:{f:KZ},177:{T:1},178:{T:-1},179:{T:1},180:{T:-1},181:{T:1},182:{T:-1},183:{T:1},184:{T:-1},185:{T:1},186:{T:-1},187:{T:1},188:{T:-1},189:{T:1},190:{T:-1},191:{T:1},192:{T:-1},193:{T:1},194:{T:-1},195:{T:1},196:{T:-1},197:{T:1},198:{T:-1},199:{T:1},200:{T:-1},201:{T:1},202:{T:-1},203:{T:1},204:{T:-1},205:{T:1},206:{T:-1},207:{T:1},208:{T:-1},209:{T:1},210:{T:-1},211:{T:1},212:{T:-1},213:{T:1},214:{T:-1},215:{T:1},216:{T:-1},217:{T:1},218:{T:-1},219:{T:1},220:{T:-1},221:{T:1},222:{T:-1},223:{T:1},224:{T:-1},225:{T:1},226:{T:-1},227:{T:1},228:{T:-1},229:{T:1},230:{T:-1},231:{T:1},232:{T:-1},233:{T:1},234:{T:-1},235:{T:1},236:{T:-1},237:{T:1},238:{T:-1},239:{T:1},240:{T:-1},241:{T:1},242:{T:-1},243:{T:1},244:{T:-1},245:{T:1},246:{T:-1},247:{T:1},248:{T:-1},249:{T:1},250:{T:-1},251:{T:1},252:{T:-1},253:{T:1},254:{T:-1},255:{T:1},256:{T:-1},257:{T:1},258:{T:-1},259:{T:1},260:{T:-1},261:{T:1},262:{T:-1},263:{T:1},264:{T:-1},265:{T:1},266:{T:-1},267:{T:1},268:{T:-1},269:{T:1},270:{T:-1},271:{T:1},272:{T:-1},273:{T:1},274:{T:-1},275:{T:1},276:{T:-1},277:{},278:{T:1},279:{T:-1},280:{T:1},281:{T:-1},282:{T:1},283:{T:1},284:{T:-1},285:{T:1},286:{T:-1},287:{T:1},288:{T:-1},289:{T:1},290:{T:-1},291:{T:1},292:{T:-1},293:{T:1},294:{T:-1},295:{T:1},296:{T:-1},297:{T:1},298:{T:-1},299:{T:1},300:{T:-1},301:{T:1},302:{T:-1},303:{T:1},304:{T:-1},305:{T:1},306:{T:-1},307:{T:1},308:{T:-1},309:{T:1},310:{T:-1},311:{T:1},312:{T:-1},313:{T:-1},314:{T:1},315:{T:-1},316:{T:1},317:{T:-1},318:{T:1},319:{T:-1},320:{T:1},321:{T:-1},322:{T:1},323:{T:-1},324:{T:1},325:{T:-1},326:{T:1},327:{T:-1},328:{T:1},329:{T:-1},330:{T:1},331:{T:-1},332:{T:1},333:{T:-1},334:{T:1},335:{f:iX},336:{T:-1},337:{f:cX,T:1},338:{T:-1},339:{T:1},340:{T:-1},341:{T:1},342:{T:-1},343:{T:1},344:{T:-1},345:{T:1},346:{T:-1},347:{T:1},348:{T:-1},349:{T:1},350:{T:-1},351:{},352:{},353:{T:1},354:{T:-1},355:{f:I_},357:{},358:{},359:{},360:{T:1},361:{},362:{f:hY},363:{},364:{},366:{},367:{},368:{},369:{},370:{},371:{},372:{T:1},373:{T:-1},374:{T:1},375:{T:-1},376:{T:1},377:{T:-1},378:{T:1},379:{T:-1},380:{T:1},381:{T:-1},382:{T:1},383:{T:-1},384:{T:1},385:{T:-1},386:{T:1},387:{T:-1},388:{T:1},389:{T:-1},390:{T:1},391:{T:-1},392:{T:1},393:{T:-1},394:{T:1},395:{T:-1},396:{},397:{},398:{},399:{},400:{},401:{T:1},403:{},404:{},405:{},406:{},407:{},408:{},409:{},410:{},411:{},412:{},413:{},414:{},415:{},416:{},417:{},418:{},419:{},420:{},421:{},422:{T:1},423:{T:1},424:{T:-1},425:{T:-1},426:{f:eee},427:{f:tee},428:{},429:{T:1},430:{T:-1},431:{T:1},432:{T:-1},433:{T:1},434:{T:-1},435:{T:1},436:{T:-1},437:{T:1},438:{T:-1},439:{T:1},440:{T:-1},441:{T:1},442:{T:-1},443:{T:1},444:{T:-1},445:{T:1},446:{T:-1},447:{T:1},448:{T:-1},449:{T:1},450:{T:-1},451:{T:1},452:{T:-1},453:{T:1},454:{T:-1},455:{T:1},456:{T:-1},457:{T:1},458:{T:-1},459:{T:1},460:{T:-1},461:{T:1},462:{T:-1},463:{T:1},464:{T:-1},465:{T:1},466:{T:-1},467:{T:1},468:{T:-1},469:{T:1},470:{T:-1},471:{},472:{},473:{T:1},474:{T:-1},475:{},476:{f:ree},477:{},478:{},479:{T:1},480:{T:-1},481:{T:1},482:{T:-1},483:{T:1},484:{T:-1},485:{f:hZ},486:{T:1},487:{T:-1},488:{T:1},489:{T:-1},490:{T:1},491:{T:-1},492:{T:1},493:{T:-1},494:{f:XZ},495:{T:1},496:{T:-1},497:{T:1},498:{T:-1},499:{},500:{T:1},501:{T:-1},502:{T:1},503:{T:-1},504:{},505:{T:1},506:{T:-1},507:{},508:{T:1},509:{T:-1},510:{T:1},511:{T:-1},512:{},513:{},514:{T:1},515:{T:-1},516:{T:1},517:{T:-1},518:{T:1},519:{T:-1},520:{T:1},521:{T:-1},522:{},523:{},524:{},525:{},526:{},527:{},528:{T:1},529:{T:-1},530:{T:1},531:{T:-1},532:{T:1},533:{T:-1},534:{},535:{},536:{},537:{},538:{T:1},539:{T:-1},540:{T:1},541:{T:-1},542:{T:1},548:{},549:{},550:{f:I_},551:{},552:{},553:{},554:{T:1},555:{T:-1},556:{T:1},557:{T:-1},558:{T:1},559:{T:-1},560:{T:1},561:{T:-1},562:{},564:{},565:{T:1},566:{T:-1},569:{T:1},570:{T:-1},572:{},573:{T:1},574:{T:-1},577:{},578:{},579:{},580:{},581:{},582:{},583:{},584:{},585:{},586:{},587:{},588:{T:-1},589:{},590:{T:1},591:{T:-1},592:{T:1},593:{T:-1},594:{T:1},595:{T:-1},596:{},597:{T:1},598:{T:-1},599:{T:1},600:{T:-1},601:{T:1},602:{T:-1},603:{T:1},604:{T:-1},605:{T:1},606:{T:-1},607:{},608:{T:1},609:{T:-1},610:{},611:{T:1},612:{T:-1},613:{T:1},614:{T:-1},615:{T:1},616:{T:-1},617:{T:1},618:{T:-1},619:{T:1},620:{T:-1},625:{},626:{T:1},627:{T:-1},628:{T:1},629:{T:-1},630:{T:1},631:{T:-1},632:{f:_X},633:{T:1},634:{T:-1},635:{T:1,f:gX},636:{T:-1},637:{f:bJ},638:{T:1},639:{},640:{T:-1},641:{T:1},642:{T:-1},643:{T:1},644:{},645:{T:-1},646:{T:1},648:{T:1},649:{},650:{T:-1},651:{f:xee},652:{},653:{T:1},654:{T:-1},655:{T:1},656:{T:-1},657:{T:1},658:{T:-1},659:{},660:{T:1},661:{},662:{T:-1},663:{},664:{T:1},665:{},666:{T:-1},667:{},668:{},669:{},671:{T:1},672:{T:-1},673:{T:1},674:{T:-1},675:{},676:{},677:{},678:{},679:{},680:{},681:{},1024:{},1025:{},1026:{T:1},1027:{T:-1},1028:{T:1},1029:{T:-1},1030:{},1031:{T:1},1032:{T:-1},1033:{T:1},1034:{T:-1},1035:{},1036:{},1037:{},1038:{T:1},1039:{T:-1},1040:{},1041:{T:1},1042:{T:-1},1043:{},1044:{},1045:{},1046:{T:1},1047:{T:-1},1048:{T:1},1049:{T:-1},1050:{},1051:{T:1},1052:{T:1},1053:{f:cee},1054:{T:1},1055:{},1056:{T:1},1057:{T:-1},1058:{T:1},1059:{T:-1},1061:{},1062:{T:1},1063:{T:-1},1064:{T:1},1065:{T:-1},1066:{T:1},1067:{T:-1},1068:{T:1},1069:{T:-1},1070:{T:1},1071:{T:-1},1072:{T:1},1073:{T:-1},1075:{T:1},1076:{T:-1},1077:{T:1},1078:{T:-1},1079:{T:1},1080:{T:-1},1081:{T:1},1082:{T:-1},1083:{T:1},1084:{T:-1},1085:{},1086:{T:1},1087:{T:-1},1088:{T:1},1089:{T:-1},1090:{T:1},1091:{T:-1},1092:{T:1},1093:{T:-1},1094:{T:1},1095:{T:-1},1096:{},1097:{T:1},1098:{},1099:{T:-1},1100:{T:1},1101:{T:-1},1102:{},1103:{},1104:{},1105:{},1111:{},1112:{},1113:{T:1},1114:{T:-1},1115:{T:1},1116:{T:-1},1117:{},1118:{T:1},1119:{T:-1},1120:{T:1},1121:{T:-1},1122:{T:1},1123:{T:-1},1124:{T:1},1125:{T:-1},1126:{},1128:{T:1},1129:{T:-1},1130:{},1131:{T:1},1132:{T:-1},1133:{T:1},1134:{T:-1},1135:{T:1},1136:{T:-1},1137:{T:1},1138:{T:-1},1139:{T:1},1140:{T:-1},1141:{},1142:{T:1},1143:{T:-1},1144:{T:1},1145:{T:-1},1146:{},1147:{T:1},1148:{T:-1},1149:{T:1},1150:{T:-1},1152:{T:1},1153:{T:-1},1154:{T:-1},1155:{T:-1},1156:{T:-1},1157:{T:1},1158:{T:-1},1159:{T:1},1160:{T:-1},1161:{T:1},1162:{T:-1},1163:{T:1},1164:{T:-1},1165:{T:1},1166:{T:-1},1167:{T:1},1168:{T:-1},1169:{T:1},1170:{T:-1},1171:{},1172:{T:1},1173:{T:-1},1177:{},1178:{T:1},1180:{},1181:{},1182:{},2048:{T:1},2049:{T:-1},2050:{},2051:{T:1},2052:{T:-1},2053:{},2054:{},2055:{T:1},2056:{T:-1},2057:{T:1},2058:{T:-1},2060:{},2067:{},2068:{T:1},2069:{T:-1},2070:{},2071:{},2072:{T:1},2073:{T:-1},2075:{},2076:{},2077:{T:1},2078:{T:-1},2079:{},2080:{T:1},2081:{T:-1},2082:{},2083:{T:1},2084:{T:-1},2085:{T:1},2086:{T:-1},2087:{T:1},2088:{T:-1},2089:{T:1},2090:{T:-1},2091:{},2092:{},2093:{T:1},2094:{T:-1},2095:{},2096:{T:1},2097:{T:-1},2098:{T:1},2099:{T:-1},2100:{T:1},2101:{T:-1},2102:{},2103:{T:1},2104:{T:-1},2105:{},2106:{T:1},2107:{T:-1},2108:{},2109:{T:1},2110:{T:-1},2111:{T:1},2112:{T:-1},2113:{T:1},2114:{T:-1},2115:{},2116:{},2117:{},2118:{T:1},2119:{T:-1},2120:{},2121:{T:1},2122:{T:-1},2123:{T:1},2124:{T:-1},2125:{},2126:{T:1},2127:{T:-1},2128:{},2129:{T:1},2130:{T:-1},2131:{T:1},2132:{T:-1},2133:{T:1},2134:{},2135:{},2136:{},2137:{T:1},2138:{T:-1},2139:{T:1},2140:{T:-1},2141:{},3072:{},3073:{},4096:{T:1},4097:{T:-1},5002:{T:1},5003:{T:-1},5081:{T:1},5082:{T:-1},5083:{},5084:{T:1},5085:{T:-1},5086:{T:1},5087:{T:-1},5088:{},5089:{},5090:{},5092:{T:1},5093:{T:-1},5094:{},5095:{T:1},5096:{T:-1},5097:{},5099:{},65535:{n:""}};function he(t,e,n,r){var a=e;if(!isNaN(a)){var i=r||(n||[]).length||0,s=t.next(4);s.write_shift(2,a),s.write_shift(2,i),i>0&&Sb(n)&&t.push(n)}}function ite(t,e,n,r){var a=(n||[]).length||0;if(a<=8224)return he(t,e,n,a);var i=e;if(!isNaN(i)){for(var s=n.parts||[],o=0,l=0,u=0;u+(s[o]||8224)<=8224;)u+=s[o]||8224,o++;var c=t.next(4);for(c.write_shift(2,i),c.write_shift(2,u),t.push(n.slice(l,l+u)),l+=u;l=0&&a<65536?he(t,2,xY(n,r,a)):he(t,3,bY(n,r,a));return;case"b":case"e":he(t,5,ste(n,r,e.v,e.t));return;case"s":case"str":he(t,4,ote(n,r,(e.v||"").slice(0,255)));return}he(t,1,wh(null,n,r))}function ute(t,e,n,r){var a=Array.isArray(e),i=Ct(e["!ref"]||"A1"),s,o="",l=[];if(i.e.c>255||i.e.r>16383){if(r.WTF)throw new Error("Range "+(e["!ref"]||"A1")+" exceeds format limit A1:IV16384");i.e.c=Math.min(i.e.c,255),i.e.r=Math.min(i.e.c,16383),s=Kt(i)}for(var u=i.s.r;u<=i.e.r;++u){o=Cn(u);for(var c=i.s.c;c<=i.e.c;++c){u===i.s.r&&(l[c]=Un(c)),s=l[c]+o;var h=a?(e[u]||[])[c]:e[s];h&<e(t,h,u,c)}}}function cte(t,e){for(var n=e||{},r=ur(),a=0,i=0;i255||p.e.r>=g){if(e.WTF)throw new Error("Range "+(i["!ref"]||"A1")+" exceeds format limit A1:IV16384");p.e.c=Math.min(p.e.c,255),p.e.r=Math.min(p.e.c,g-1)}he(r,2057,Pb(n,16,e)),he(r,13,Fr(1)),he(r,12,Fr(100)),he(r,15,Hn(!0)),he(r,17,Hn(!1)),he(r,16,Po(.001)),he(r,95,Hn(!0)),he(r,42,Hn(!1)),he(r,43,Hn(!1)),he(r,130,Fr(1)),he(r,128,uY()),he(r,131,Hn(!1)),he(r,132,Hn(!1)),u&>e(r,i["!cols"]),he(r,512,lY(p,e)),u&&(i["!links"]=[]);for(var m=p.s.r;m<=p.e.r;++m){h=Cn(m);for(var _=p.s.c;_<=p.e.c;++_){m===p.s.r&&(f[_]=Un(_)),c=f[_]+h;var x=l?(i[m]||[])[_]:i[c];x&&(vte(r,x,m,_,e),u&&x.l&&i["!links"].push([c,x.l]))}}var E=o.CodeName||o.name||a;return u&&he(r,574,rY((s.Views||[])[0])),u&&(i["!merges"]||[]).length&&he(r,229,pY(i["!merges"])),u&&mte(r,i),he(r,442,IO(E)),u&&fte(r,i),he(r,10),r.end()}function yte(t,e,n){var r=ur(),a=(t||{}).Workbook||{},i=a.Sheets||[],s=a.WBProps||{},o=n.biff==8,l=n.biff==5;if(he(r,2057,Pb(t,5,n)),n.bookType=="xla"&&he(r,135),he(r,225,o?Fr(1200):null),he(r,193,GJ(2)),l&&he(r,191),l&&he(r,192),he(r,226),he(r,92,ZJ("SheetJS",n)),he(r,66,Fr(o?1200:1252)),o&&he(r,353,Fr(0)),o&&he(r,448),he(r,317,EY(t.SheetNames.length)),o&&t.vbaraw&&he(r,211),o&&t.vbaraw){var u=s.CodeName||"ThisWorkbook";he(r,442,IO(u))}he(r,156,Fr(17)),he(r,25,Hn(!1)),he(r,18,Hn(!1)),he(r,19,Fr(0)),o&&he(r,431,Hn(!1)),o&&he(r,444,Fr(0)),he(r,61,nY()),he(r,64,Hn(!1)),he(r,141,Fr(0)),he(r,34,Hn(Tee(t)=="true")),he(r,14,Hn(!0)),o&&he(r,439,Hn(!1)),he(r,218,Fr(0)),dte(r,t,n),hte(r,t.SSF,n),pte(r,n),o&&he(r,352,Hn(!1));var c=r.end(),h=ur();o&&he(h,140,vY()),o&&n.Strings&&ite(h,252,tY(n.Strings)),he(h,10);var f=h.end(),p=ur(),g=0,m=0;for(m=0;m255&&typeof console<"u"&&console.error&&console.error("Worksheet '"+t.SheetNames[n]+"' extends beyond column IV (255). Data may be lost.")}}var i=e||{};switch(i.biff||2){case 8:case 5:return Ete(t,e);case 4:case 3:case 2:return cte(t,e)}throw new Error("invalid type "+i.bookType+" for BIFF")}function bte(t,e,n,r){for(var a=t["!merges"]||[],i=[],s=e.s.c;s<=e.e.c;++s){for(var o=0,l=0,u=0;un||a[u].s.c>s)&&!(a[u].e.r1&&(p.rowspan=o),l>1&&(p.colspan=l),r.editable?f=''+f+"":h&&(p["data-t"]=h&&h.t||"z",h.v!=null&&(p["data-v"]=h.v),h.z!=null&&(p["data-z"]=h.z),h.l&&(h.l.Target||"#").charAt(0)!="#"&&(f=''+f+"")),p.id=(r.id||"sjs")+"-"+c,i.push(de("td",f,p))}}var g="";return g+i.join("")+""}var xte='SheetJS Table Export',Ste="";function Tte(t,e,n){var r=[];return r.join("")+""}function n3(t,e){var n=e||{},r=n.header!=null?n.header:xte,a=n.footer!=null?n.footer:Ste,i=[r],s=Rr(t["!ref"]);n.dense=Array.isArray(t),i.push(Tte(t,s,n));for(var o=s.s.r;o<=s.e.r;++o)i.push(bte(t,s,o,n));return i.push(""+a),i.join("")}function r3(t,e,n){var r=n||{},a=0,i=0;if(r.origin!=null)if(typeof r.origin=="number")a=r.origin;else{var s=typeof r.origin=="string"?dn(r.origin):r.origin;a=s.r,i=s.c}var o=e.getElementsByTagName("tr"),l=Math.min(r.sheetRows||1e7,o.length),u={s:{r:0,c:0},e:{r:a,c:i}};if(t["!ref"]){var c=Rr(t["!ref"]);u.s.r=Math.min(u.s.r,c.s.r),u.s.c=Math.min(u.s.c,c.s.c),u.e.r=Math.max(u.e.r,c.e.r),u.e.c=Math.max(u.e.c,c.e.c),a==-1&&(u.e.r=a=c.e.r+1)}var h=[],f=0,p=t["!rows"]||(t["!rows"]=[]),g=0,m=0,_=0,x=0,E=0,y=0;for(t["!cols"]||(t["!cols"]=[]);g1||y>1)&&h.push({s:{r:m+a,c:x+i},e:{r:m+a+(E||1)-1,c:x+i+(y||1)-1}});var A={t:"s",v:T},R=G.getAttribute("data-t")||G.getAttribute("t")||"";T!=null&&(T.length==0?A.t=R||"z":r.raw||T.trim().length==0||R=="s"||(T==="TRUE"?A={t:"b",v:!0}:T==="FALSE"?A={t:"b",v:!1}:isNaN(ni(T))?isNaN(Ud(T).getDate())||(A={t:"d",v:Yn(T)},r.cellDates||(A={t:"n",v:dr(A.v)}),A.z=r.dateNF||Bt[14]):A={t:"n",v:ni(T)})),A.z===void 0&&S!=null&&(A.z=S);var L="",N=G.getElementsByTagName("A");if(N&&N.length)for(var Re=0;Re=l&&(t["!fullref"]=Kt((u.e.r=o.length-g+m-1+a,u))),t}function a3(t,e){var n=e||{},r=n.dense?[]:{};return r3(r,t,e)}function wte(t,e){return Uo(a3(t,e),e)}function lC(t){var e="",n=Cte(t);return n&&(e=n(t).getPropertyValue("display")),e||(e=t.style&&t.style.display),e==="none"}function Cte(t){return t.ownerDocument.defaultView&&typeof t.ownerDocument.defaultView.getComputedStyle=="function"?t.ownerDocument.defaultView.getComputedStyle:typeof getComputedStyle=="function"?getComputedStyle:null}var Ate=function(){var t=["",'',"",'',"",'',"",""].join(""),e=""+t+"";return function(){return Yt+e}}(),uC=function(){var t=function(i){return ct(i).replace(/ +/g,function(s){return''}).replace(/\t/g,"").replace(/\n/g,"").replace(/^ /,"").replace(/ $/,"")},e=` `,n=` `,r=function(i,s,o){var l=[];l.push(' `);var u=0,c=0,h=Rr(i["!ref"]||"A1"),f=i["!merges"]||[],p=0,g=Array.isArray(i);if(i["!cols"])for(c=0;c<=h.e.c;++c)l.push(" `);var m="",_=i["!rows"]||[];for(u=0;u `);for(;u<=h.e.r;++u){for(m=_[u]?' table:style-name="ro'+_[u].ods+'"':"",l.push(" `),c=0;cc)&&!(f[p].s.r>u)&&!(f[p].e.c `)}return l.push(` `),l.join("")},a=function(i,s){i.push(` `),i.push(` `),i.push(` `),i.push(` / `),i.push(` `),i.push(` / `),i.push(` `),i.push(` `);var o=0;s.SheetNames.map(function(u){return s.Sheets[u]}).forEach(function(u){if(u&&u["!cols"]){for(var c=0;c `),i.push(' `),i.push(` `),++o}}});var l=0;s.SheetNames.map(function(u){return s.Sheets[u]}).forEach(function(u){if(u&&u["!rows"]){for(var c=0;c `),i.push(' `),i.push(` `),++l}}}),i.push(` `),i.push(` `),i.push(` `),i.push(` `),i.push(` `)};return function(s,o){var l=[Yt],u=jd({"xmlns:office":"urn:oasis:names:tc:opendocument:xmlns:office:1.0","xmlns:table":"urn:oasis:names:tc:opendocument:xmlns:table:1.0","xmlns:style":"urn:oasis:names:tc:opendocument:xmlns:style:1.0","xmlns:text":"urn:oasis:names:tc:opendocument:xmlns:text:1.0","xmlns:draw":"urn:oasis:names:tc:opendocument:xmlns:drawing:1.0","xmlns:fo":"urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0","xmlns:xlink":"http://www.w3.org/1999/xlink","xmlns:dc":"http://purl.org/dc/elements/1.1/","xmlns:meta":"urn:oasis:names:tc:opendocument:xmlns:meta:1.0","xmlns:number":"urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0","xmlns:presentation":"urn:oasis:names:tc:opendocument:xmlns:presentation:1.0","xmlns:svg":"urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0","xmlns:chart":"urn:oasis:names:tc:opendocument:xmlns:chart:1.0","xmlns:dr3d":"urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0","xmlns:math":"http://www.w3.org/1998/Math/MathML","xmlns:form":"urn:oasis:names:tc:opendocument:xmlns:form:1.0","xmlns:script":"urn:oasis:names:tc:opendocument:xmlns:script:1.0","xmlns:ooo":"http://openoffice.org/2004/office","xmlns:ooow":"http://openoffice.org/2004/writer","xmlns:oooc":"http://openoffice.org/2004/calc","xmlns:dom":"http://www.w3.org/2001/xml-events","xmlns:xforms":"http://www.w3.org/2002/xforms","xmlns:xsd":"http://www.w3.org/2001/XMLSchema","xmlns:xsi":"http://www.w3.org/2001/XMLSchema-instance","xmlns:sheet":"urn:oasis:names:tc:opendocument:sh33tjs:1.0","xmlns:rpt":"http://openoffice.org/2005/report","xmlns:of":"urn:oasis:names:tc:opendocument:xmlns:of:1.2","xmlns:xhtml":"http://www.w3.org/1999/xhtml","xmlns:grddl":"http://www.w3.org/2003/g/data-view#","xmlns:tableooo":"http://openoffice.org/2009/table","xmlns:drawooo":"http://openoffice.org/2010/draw","xmlns:calcext":"urn:org:documentfoundation:names:experimental:calc:xmlns:calcext:1.0","xmlns:loext":"urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0","xmlns:field":"urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0","xmlns:formx":"urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0","xmlns:css3t":"http://www.w3.org/TR/css3-text/","office:version":"1.2"}),c=jd({"xmlns:config":"urn:oasis:names:tc:opendocument:xmlns:config:1.0","office:mimetype":"application/vnd.oasis.opendocument.spreadsheet"});o.bookType=="fods"?(l.push(" `),l.push(yO().replace(/office:document-meta/g,"office:meta"))):l.push(" `),a(l,s),l.push(` `),l.push(` `);for(var h=0;h!=s.SheetNames.length;++h)l.push(r(s.Sheets[s.SheetNames[h]],s,h));return l.push(` `),l.push(` `),o.bookType=="fods"?l.push(""):l.push(""),l.join("")}}();function i3(t,e){if(e.bookType=="fods")return uC(t,e);var n=yb(),r="",a=[],i=[];return r="mimetype",Ve(n,r,"application/vnd.oasis.opendocument.spreadsheet"),r="content.xml",Ve(n,r,uC(t,e)),a.push([r,"text/xml"]),i.push([r,"ContentFile"]),r="styles.xml",Ve(n,r,Ate(t,e)),a.push([r,"text/xml"]),i.push([r,"StylesFile"]),r="meta.xml",Ve(n,r,Yt+yO()),a.push([r,"text/xml"]),i.push([r,"MetadataFile"]),r="manifest.rdf",Ve(n,r,UJ(i)),a.push([r,"application/rdf+xml"]),r="META-INF/manifest.xml",Ve(n,r,FJ(a)),n}/*! sheetjs (C) 2013-present SheetJS -- http://sheetjs.com */function E0(t){return new DataView(t.buffer,t.byteOffset,t.byteLength)}function Ite(t){return typeof TextEncoder<"u"?new TextEncoder().encode(t):ea(Vd(t))}function Pte(t,e){e:for(var n=0;n<=t.length-e.length;++n){for(var r=0;r>7,t[e+14]|=(r&127)<<1;for(var i=0;a>=1;++i,a/=256)t[e+i]=a&255;t[e+15]|=n>=0?0:128}function zd(t,e){var n=e?e[0]:0,r=t[n]&127;e:if(t[n++]>=128&&(r|=(t[n]&127)<<7,t[n++]<128||(r|=(t[n]&127)<<14,t[n++]<128)||(r|=(t[n]&127)<<21,t[n++]<128)||(r+=(t[n]&127)*Math.pow(2,28),++n,t[n++]<128)||(r+=(t[n]&127)*Math.pow(2,35),++n,t[n++]<128)||(r+=(t[n]&127)*Math.pow(2,42),++n,t[n++]<128)))break e;return e&&(e[0]=n),r}function lt(t){var e=new Uint8Array(7);e[0]=t&127;var n=1;e:if(t>127){if(e[n-1]|=128,e[n]=t>>7&127,++n,t<=16383||(e[n-1]|=128,e[n]=t>>14&127,++n,t<=2097151)||(e[n-1]|=128,e[n]=t>>21&127,++n,t<=268435455)||(e[n-1]|=128,e[n]=t/256>>>21&127,++n,t<=34359738367)||(e[n-1]|=128,e[n]=t/65536>>>21&127,++n,t<=4398046511103))break e;e[n-1]|=128,e[n]=t/16777216>>>21&127,++n}return e.slice(0,n)}function Vl(t){var e=0,n=t[e]&127;e:if(t[e++]>=128){if(n|=(t[e]&127)<<7,t[e++]<128||(n|=(t[e]&127)<<14,t[e++]<128)||(n|=(t[e]&127)<<21,t[e++]<128))break e;n|=(t[e]&127)<<28}return n}function Zt(t){for(var e=[],n=[0];n[0]=128;);o=t.slice(l,n[0])}break;case 5:s=4,o=t.slice(n[0],n[0]+s),n[0]+=s;break;case 1:s=8,o=t.slice(n[0],n[0]+s),n[0]+=s;break;case 2:s=zd(t,n),o=t.slice(n[0],n[0]+s),n[0]+=s;break;case 3:case 4:default:throw new Error("PB Type ".concat(i," for Field ").concat(a," at offset ").concat(r))}var u={data:o,type:i};e[a]==null?e[a]=[u]:e[a].push(u)}return e}function _n(t){var e=[];return t.forEach(function(n,r){n.forEach(function(a){a.data&&(e.push(lt(r*8+a.type)),a.type==2&&e.push(lt(a.data.length)),e.push(a.data))})}),Ts(e)}function Kr(t){for(var e,n=[],r=[0];r[0]>>0>0),n.push(s)}return n}function el(t){var e=[];return t.forEach(function(n){var r=[];r[1]=[{data:lt(n.id),type:0}],r[2]=[],n.merge!=null&&(r[3]=[{data:lt(+!!n.merge),type:0}]);var a=[];n.messages.forEach(function(s){a.push(s.data),s.meta[3]=[{type:0,data:lt(s.data.length)}],r[2].push({data:_n(s.meta),type:2})});var i=_n(r);e.push(lt(i.length)),e.push(i),a.forEach(function(s){return e.push(s)})}),Ts(e)}function kte(t,e){if(t!=0)throw new Error("Unexpected Snappy chunk type ".concat(t));for(var n=[0],r=zd(e,n),a=[];n[0]>2;if(s<60)++s;else{var o=s-59;s=e[n[0]],o>1&&(s|=e[n[0]+1]<<8),o>2&&(s|=e[n[0]+2]<<16),o>3&&(s|=e[n[0]+3]<<24),s>>>=0,s++,n[0]+=o}a.push(e.slice(n[0],n[0]+s)),n[0]+=s;continue}else{var l=0,u=0;if(i==1?(u=(e[n[0]]>>2&7)+4,l=(e[n[0]++]&224)<<3,l|=e[n[0]++]):(u=(e[n[0]++]>>2)+1,i==2?(l=e[n[0]]|e[n[0]+1]<<8,n[0]+=2):(l=(e[n[0]]|e[n[0]+1]<<8|e[n[0]+2]<<16|e[n[0]+3]<<24)>>>0,n[0]+=4)),a=[Ts(a)],l==0)throw new Error("Invalid offset 0");if(l>a[0].length)throw new Error("Invalid offset beyond length");if(u>=l)for(a.push(a[0].slice(-l)),u-=l;u>=a[a.length-1].length;)a.push(a[a.length-1]),u-=a[a.length-1].length;a.push(a[0].slice(-l,-l+u))}}var c=Ts(a);if(c.length!=r)throw new Error("Unexpected length: ".concat(c.length," != ").concat(r));return c}function Jr(t){for(var e=[],n=0;n>8&255]))):r<=16777216?(s+=4,e.push(new Uint8Array([248,r-1&255,r-1>>8&255,r-1>>16&255]))):r<=4294967296&&(s+=5,e.push(new Uint8Array([252,r-1&255,r-1>>8&255,r-1>>16&255,r-1>>>24&255]))),e.push(t.slice(n,n+r)),s+=r,a[0]=0,a[1]=s&255,a[2]=s>>8&255,a[3]=s>>16&255,n+=r}return Ts(e)}function fv(t,e){var n=new Uint8Array(32),r=E0(n),a=12,i=0;switch(n[0]=5,t.t){case"n":n[1]=2,Rte(n,a,t.v),i|=1,a+=16;break;case"b":n[1]=6,r.setFloat64(a,t.v?1:0,!0),i|=2,a+=8;break;case"s":if(e.indexOf(t.v)==-1)throw new Error("Value ".concat(t.v," missing from SST!"));n[1]=3,r.setUint32(a,e.indexOf(t.v),!0),i|=8,a+=4;break;default:throw"unsupported cell type "+t.t}return r.setUint32(8,i,!0),n.slice(0,a)}function pv(t,e){var n=new Uint8Array(32),r=E0(n),a=12,i=0;switch(n[0]=3,t.t){case"n":n[2]=2,r.setFloat64(a,t.v,!0),i|=32,a+=8;break;case"b":n[2]=6,r.setFloat64(a,t.v?1:0,!0),i|=32,a+=8;break;case"s":if(e.indexOf(t.v)==-1)throw new Error("Value ".concat(t.v," missing from SST!"));n[2]=3,r.setUint32(a,e.indexOf(t.v),!0),i|=16,a+=4;break;default:throw"unsupported cell type "+t.t}return r.setUint32(4,i,!0),n.slice(0,a)}function ki(t){var e=Zt(t);return zd(e[1][0].data)}function Nte(t,e,n){var r,a,i,s;if(!((r=t[6])!=null&&r[0])||!((a=t[7])!=null&&a[0]))throw"Mutation only works on post-BNC storages!";var o=((s=(i=t[8])==null?void 0:i[0])==null?void 0:s.data)&&Vl(t[8][0].data)>0||!1;if(o)throw"Math only works with normal offsets";for(var l=0,u=E0(t[7][0].data),c=0,h=[],f=E0(t[4][0].data),p=0,g=[],m=0;m1&&console.error("The Numbers writer currently writes only the first table");var r=Rr(n["!ref"]);r.s.r=r.s.c=0;var a=!1;r.e.c>9&&(a=!0,r.e.c=9),r.e.r>49&&(a=!0,r.e.r=49),a&&console.error("The Numbers writer is currently limited to ".concat(Kt(r)));var i=b0(n,{range:r,header:1}),s=["~Sh33tJ5~"];i.forEach(function(H){return H.forEach(function(q){typeof q=="string"&&s.push(q)})});var o={},l=[],u=pt.read(e.numbers,{type:"base64"});u.FileIndex.map(function(H,q){return[H,u.FullPaths[q]]}).forEach(function(H){var q=H[0],z=H[1];if(q.type==2&&q.name.match(/\.iwa/)){var re=q.content,_e=Jr(re),Ae=Kr(_e);Ae.forEach(function(Se){l.push(Se.id),o[Se.id]={deps:[],location:z,type:Vl(Se.messages[0].meta[1][0].data)}})}}),l.sort(function(H,q){return H-q});var c=l.filter(function(H){return H>1}).map(function(H){return[H,lt(H)]});u.FileIndex.map(function(H,q){return[H,u.FullPaths[q]]}).forEach(function(H){var q=H[0];if(H[1],!!q.name.match(/\.iwa/)){var z=Kr(Jr(q.content));z.forEach(function(re){re.messages.forEach(function(_e){c.forEach(function(Ae){re.messages.some(function(Se){return Vl(Se.meta[1][0].data)!=11006&&Pte(Se.data,Ae[1])})&&o[Ae[0]].deps.push(re.id)})})})}});for(var h=pt.find(u,o[1].location),f=Kr(Jr(h.content)),p,g=0;g-1,a=gO();Lb(e=e||{});var i=yb(),s="",o=0;if(e.cellXfs=[],Rs(e.cellXfs,{},{revssf:{General:0}}),t.Props||(t.Props={}),s="docProps/core.xml",Ve(i,s,EO(t.Props,e)),a.coreprops.push(s),ut(e.rels,2,s,rt.CORE_PROPS),s="docProps/app.xml",!(t.Props&&t.Props.SheetNames))if(!t.Workbook||!t.Workbook.Sheets)t.Props.SheetNames=t.SheetNames;else{for(var l=[],u=0;u0&&(s="docProps/custom.xml",Ve(i,s,SO(t.Custprops)),a.custprops.push(s),ut(e.rels,4,s,rt.CUST_PROPS)),o=1;o<=t.SheetNames.length;++o){var c={"!id":{}},h=t.Sheets[t.SheetNames[o-1]],f=(h||{})["!type"]||"sheet";switch(f){case"chart":default:s="xl/worksheets/sheet"+o+"."+n,Ve(i,s,Uee(o-1,s,e,t,c)),a.sheets.push(s),ut(e.wbrels,-1,"worksheets/sheet"+o+"."+n,rt.WS[0])}if(h){var p=h["!comments"],g=!1,m="";p&&p.length>0&&(m="xl/comments"+o+"."+n,Ve(i,m,zee(p,m)),a.comments.push(m),ut(c,-1,"../comments"+o+"."+n,rt.CMNT),g=!0),h["!legacy"]&&g&&Ve(i,"xl/drawings/vmlDrawing"+o+".vml",UO(o,h["!comments"])),delete h["!comments"],delete h["!legacy"]}c["!id"].rId1&&Ve(i,_O(s),Bl(c))}return e.Strings!=null&&e.Strings.length>0&&(s="xl/sharedStrings."+n,Ve(i,s,jee(e.Strings,s,e)),a.strs.push(s),ut(e.wbrels,-1,"sharedStrings."+n,rt.SST)),s="xl/workbook."+n,Ve(i,s,Bee(t,s)),a.workbooks.push(s),ut(e.rels,1,s,rt.WB),s="xl/theme/theme1.xml",Ve(i,s,FO(t.Themes,e)),a.themes.push(s),ut(e.wbrels,-1,"theme/theme1.xml",rt.THEME),s="xl/styles."+n,Ve(i,s,Vee(t,s,e)),a.styles.push(s),ut(e.wbrels,-1,"styles."+n,rt.STY),t.vbaraw&&r&&(s="xl/vbaProject.bin",Ve(i,s,t.vbaraw),a.vba.push(s),ut(e.wbrels,-1,"vbaProject.bin",rt.VBA)),s="xl/metadata."+n,Ve(i,s,qee(s)),a.metadata.push(s),ut(e.wbrels,-1,"metadata."+n,rt.XLMETA),Ve(i,"[Content_Types].xml",vO(a,e)),Ve(i,"_rels/.rels",Bl(e.rels)),Ve(i,"xl/_rels/workbook."+n+".rels",Bl(e.wbrels)),delete e.revssf,delete e.ssf,i}function Fte(t,e){xl=1024,t&&!t.SSF&&(t.SSF=hr(Bt)),t&&t.SSF&&(Bm(),Fm(t.SSF),e.revssf=Um(t.SSF),e.revssf[t.SSF[65535]]=0,e.ssf=t.SSF),e.rels={},e.wbrels={},e.Strings=[],e.Strings.Count=0,e.Strings.Unique=0,Kc?e.revStrings=new Map:(e.revStrings={},e.revStrings.foo=[],delete e.revStrings.foo);var n="xml",r=jO.indexOf(e.bookType)>-1,a=gO();Lb(e=e||{});var i=yb(),s="",o=0;if(e.cellXfs=[],Rs(e.cellXfs,{},{revssf:{General:0}}),t.Props||(t.Props={}),s="docProps/core.xml",Ve(i,s,EO(t.Props,e)),a.coreprops.push(s),ut(e.rels,2,s,rt.CORE_PROPS),s="docProps/app.xml",!(t.Props&&t.Props.SheetNames))if(!t.Workbook||!t.Workbook.Sheets)t.Props.SheetNames=t.SheetNames;else{for(var l=[],u=0;u0&&(s="docProps/custom.xml",Ve(i,s,SO(t.Custprops)),a.custprops.push(s),ut(e.rels,4,s,rt.CUST_PROPS));var c=["SheetJ5"];for(e.tcid=0,o=1;o<=t.SheetNames.length;++o){var h={"!id":{}},f=t.Sheets[t.SheetNames[o-1]],p=(f||{})["!type"]||"sheet";switch(p){case"chart":default:s="xl/worksheets/sheet"+o+"."+n,Ve(i,s,YO(o-1,e,t,h)),a.sheets.push(s),ut(e.wbrels,-1,"worksheets/sheet"+o+"."+n,rt.WS[0])}if(f){var g=f["!comments"],m=!1,_="";if(g&&g.length>0){var x=!1;g.forEach(function(E){E[1].forEach(function(y){y.T==!0&&(x=!0)})}),x&&(_="xl/threadedComments/threadedComment"+o+"."+n,Ve(i,_,pX(g,c,e)),a.threadedcomments.push(_),ut(h,-1,"../threadedComments/threadedComment"+o+"."+n,rt.TCMNT)),_="xl/comments"+o+"."+n,Ve(i,_,VO(g)),a.comments.push(_),ut(h,-1,"../comments"+o+"."+n,rt.CMNT),m=!0}f["!legacy"]&&m&&Ve(i,"xl/drawings/vmlDrawing"+o+".vml",UO(o,f["!comments"])),delete f["!comments"],delete f["!legacy"]}h["!id"].rId1&&Ve(i,_O(s),Bl(h))}return e.Strings!=null&&e.Strings.length>0&&(s="xl/sharedStrings."+n,Ve(i,s,kO(e.Strings,e)),a.strs.push(s),ut(e.wbrels,-1,"sharedStrings."+n,rt.SST)),s="xl/workbook."+n,Ve(i,s,ZO(t)),a.workbooks.push(s),ut(e.rels,1,s,rt.WB),s="xl/theme/theme1.xml",Ve(i,s,FO(t.Themes,e)),a.themes.push(s),ut(e.wbrels,-1,"theme/theme1.xml",rt.THEME),s="xl/styles."+n,Ve(i,s,LO(t,e)),a.styles.push(s),ut(e.wbrels,-1,"styles."+n,rt.STY),t.vbaraw&&r&&(s="xl/vbaProject.bin",Ve(i,s,t.vbaraw),a.vba.push(s),ut(e.wbrels,-1,"vbaProject.bin",rt.VBA)),s="xl/metadata."+n,Ve(i,s,BO()),a.metadata.push(s),ut(e.wbrels,-1,"metadata."+n,rt.XLMETA),c.length>1&&(s="xl/persons/person.xml",Ve(i,s,mX(c)),a.people.push(s),ut(e.wbrels,-1,"persons/person.xml",rt.PEOPLE)),Ve(i,"[Content_Types].xml",vO(a,e)),Ve(i,"_rels/.rels",Bl(e.rels)),Ve(i,"xl/_rels/workbook."+n+".rels",Bl(e.wbrels)),delete e.revssf,delete e.ssf,i}function Bte(t,e){var n="";switch((e||{}).type||"base64"){case"buffer":return[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7]];case"base64":n=pi(t.slice(0,12));break;case"binary":n=t;break;case"array":return[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7]];default:throw new Error("Unrecognized type "+(e&&e.type||"undefined"))}return[n.charCodeAt(0),n.charCodeAt(1),n.charCodeAt(2),n.charCodeAt(3),n.charCodeAt(4),n.charCodeAt(5),n.charCodeAt(6),n.charCodeAt(7)]}function s3(t,e){switch(e.type){case"base64":case"binary":break;case"buffer":case"array":e.type="";break;case"file":return bh(e.file,pt.write(t,{type:st?"buffer":""}));case"string":throw new Error("'string' output type invalid for '"+e.bookType+"' files");default:throw new Error("Unrecognized type "+e.type)}return pt.write(t,e)}function Ute(t,e){var n=hr(e||{}),r=Lte(t,n);return Vte(r,n)}function Vte(t,e){var n={},r=st?"nodebuffer":typeof Uint8Array<"u"?"array":"string";if(e.compression&&(n.compression="DEFLATE"),e.password)n.type=r;else switch(e.type){case"base64":n.type="base64";break;case"binary":n.type="string";break;case"string":throw new Error("'string' output type invalid for '"+e.bookType+"' files");case"buffer":case"file":n.type=r;break;default:throw new Error("Unrecognized type "+e.type)}var a=t.FullPaths?pt.write(t,{fileType:"zip",type:{nodebuffer:"buffer",string:"binary"}[n.type]||n.type,compression:!!e.compression}):t.generate(n);if(typeof Deno<"u"&&typeof a=="string"){if(e.type=="binary"||e.type=="base64")return a;a=new Uint8Array(Dm(a))}return e.password&&typeof encrypt_agile<"u"?s3(encrypt_agile(a,e.password),e):e.type==="file"?bh(e.file,a):e.type=="string"?Gc(a):a}function jte(t,e){var n=e||{},r=rte(t,n);return s3(r,n)}function ga(t,e,n){n||(n="");var r=n+t;switch(e.type){case"base64":return Bd(Vd(r));case"binary":return Vd(r);case"string":return t;case"file":return bh(e.file,r,"utf8");case"buffer":return st?bi(r,"utf8"):typeof TextEncoder<"u"?new TextEncoder().encode(r):ga(r,{type:"binary"}).split("").map(function(a){return a.charCodeAt(0)})}throw new Error("Unrecognized type "+e.type)}function zte(t,e){switch(e.type){case"base64":return Bd(t);case"binary":return t;case"string":return t;case"file":return bh(e.file,t,"binary");case"buffer":return st?bi(t,"binary"):t.split("").map(function(n){return n.charCodeAt(0)})}throw new Error("Unrecognized type "+e.type)}function Tf(t,e){switch(e.type){case"string":case"base64":case"binary":for(var n="",r=0;r0&&(a=0);var h=Cn(l.s.r),f=[],p=[],g=0,m=0,_=Array.isArray(t),x=l.s.r,E=0,y={};_&&!t[x]&&(t[x]=[]);var I=u.skipHidden&&t["!cols"]||[],j=u.skipHidden&&t["!rows"]||[];for(E=l.s.c;E<=l.e.c;++E)if(!(I[E]||{}).hidden)switch(f[E]=Un(E),n=_?t[x][E]:t[f[E]+h],r){case 1:i[E]=E-l.s.c;break;case 2:i[E]=f[E];break;case 3:i[E]=u.header[E-l.s.c];break;default:if(n==null&&(n={w:"__EMPTY",t:"s"}),o=s=mi(n,null,u),m=y[s]||0,!m)y[s]=1;else{do o=s+"_"+m++;while(y[o]);y[s]=m,y[o]=1}i[E]=o}for(x=l.s.r+a;x<=l.e.r;++x)if(!(j[x]||{}).hidden){var G=qte(t,l,x,f,r,i,_,u);(G.isempty===!1||(r===1?u.blankrows!==!1:u.blankrows))&&(p[g++]=G.row)}return p.length=g,p}var cC=/"/g;function Gte(t,e,n,r,a,i,s,o){for(var l=!0,u=[],c="",h=Cn(n),f=e.s.c;f<=e.e.c;++f)if(r[f]){var p=o.dense?(t[n]||[])[f]:t[r[f]+h];if(p==null)c="";else if(p.v!=null){l=!1,c=""+(o.rawNumbers&&p.t=="n"?p.v:mi(p,null,o));for(var g=0,m=0;g!==c.length;++g)if((m=c.charCodeAt(g))===a||m===i||m===34||o.forceQuotes){c='"'+c.replace(cC,'""')+'"';break}c=="ID"&&(c='"ID"')}else p.f!=null&&!p.F?(l=!1,c="="+p.f,c.indexOf(",")>=0&&(c='"'+c.replace(cC,'""')+'"')):c="";u.push(c)}return o.blankrows===!1&&l?null:u.join(s)}function Db(t,e){var n=[],r=e??{};if(t==null||t["!ref"]==null)return"";var a=Ct(t["!ref"]),i=r.FS!==void 0?r.FS:",",s=i.charCodeAt(0),o=r.RS!==void 0?r.RS:` `,l=o.charCodeAt(0),u=new RegExp((i=="|"?"\\|":i)+"+$"),c="",h=[];r.dense=Array.isArray(t);for(var f=r.skipHidden&&t["!cols"]||[],p=r.skipHidden&&t["!rows"]||[],g=a.s.c;g<=a.e.c;++g)(f[g]||{}).hidden||(h[g]=Un(g));for(var m=0,_=a.s.r;_<=a.e.r;++_)(p[_]||{}).hidden||(c=Gte(t,a,_,h,s,l,i,r),c!=null&&(r.strip&&(c=c.replace(u,"")),(c||r.blankrows!==!1)&&n.push((m++?o:"")+c)));return delete r.dense,n.join("")}function l3(t,e){e||(e={}),e.FS=" ",e.RS=` `;var n=Db(t,e);return n}function Hte(t){var e="",n,r="";if(t==null||t["!ref"]==null)return[];var a=Ct(t["!ref"]),i="",s=[],o,l=[],u=Array.isArray(t);for(o=a.s.c;o<=a.e.c;++o)s[o]=Un(o);for(var c=a.s.r;c<=a.e.r;++c)for(i=Cn(c),o=a.s.c;o<=a.e.c;++o)if(e=s[o]+i,n=u?(t[c]||[])[o]:t[e],r="",n!==void 0){if(n.F!=null){if(e=n.F,!n.f)continue;r=n.f,e.indexOf(":")==-1&&(e=e+":"+e)}if(n.f!=null)r=n.f;else{if(n.t=="z")continue;if(n.t=="n"&&n.v!=null)r=""+n.v;else if(n.t=="b")r=n.v?"TRUE":"FALSE";else if(n.w!==void 0)r="'"+n.w;else{if(n.v===void 0)continue;n.t=="s"?r="'"+n.v:r=""+n.v}}l[l.length]=e+"="+r}return l}function u3(t,e,n){var r=n||{},a=+!r.skipHeader,i=t||{},s=0,o=0;if(i&&r.origin!=null)if(typeof r.origin=="number")s=r.origin;else{var l=typeof r.origin=="string"?dn(r.origin):r.origin;s=l.r,o=l.c}var u,c={s:{c:0,r:0},e:{c:o,r:s+e.length-1+a}};if(i["!ref"]){var h=Ct(i["!ref"]);c.e.c=Math.max(c.e.c,h.e.c),c.e.r=Math.max(c.e.r,h.e.r),s==-1&&(s=h.e.r+1,c.e.r=s+e.length-1+a)}else s==-1&&(s=0,c.e.r=e.length-1+a);var f=r.header||[],p=0;e.forEach(function(m,_){Pn(m).forEach(function(x){(p=f.indexOf(x))==-1&&(f[p=f.length]=x);var E=m[x],y="z",I="",j=ht({c:o+p,r:s+_+a});u=qd(i,j),E&&typeof E=="object"&&!(E instanceof Date)?i[j]=E:(typeof E=="number"?y="n":typeof E=="boolean"?y="b":typeof E=="string"?y="s":E instanceof Date?(y="d",r.cellDates||(y="n",E=dr(E)),I=r.dateNF||Bt[14]):E===null&&r.nullError&&(y="e",E=0),u?(u.t=y,u.v=E,delete u.w,delete u.R,I&&(u.z=I)):i[j]=u={t:y,v:E},I&&(u.z=I))})}),c.e.c=Math.max(c.e.c,o+f.length-1);var g=Cn(s);if(a)for(p=0;p=0&&t.SheetNames.length>e)return e;throw new Error("Cannot find sheet # "+e)}else if(typeof e=="string"){var n=t.SheetNames.indexOf(e);if(n>-1)return n;throw new Error("Cannot find sheet name |"+e+"|")}else throw new Error("Cannot find sheet |"+e+"|")}function Kte(){return{SheetNames:[],Sheets:{}}}function Jte(t,e,n,r){var a=1;if(!n)for(;a<=65535&&t.SheetNames.indexOf(n="Sheet"+a)!=-1;++a,n=void 0);if(!n||t.SheetNames.length>=65535)throw new Error("Too many worksheets");if(r&&t.SheetNames.indexOf(n)>=0){var i=n.match(/(^.*?)(\d+)$/);a=i&&+i[2]||0;var s=i&&i[1]||n;for(++a;a<=65535&&t.SheetNames.indexOf(n=s+a)!=-1;++a);}if(QO(n),t.SheetNames.indexOf(n)>=0)throw new Error("Worksheet with name |"+n+"| already exists!");return t.SheetNames.push(n),t.Sheets[n]=e,n}function Yte(t,e,n){t.Workbook||(t.Workbook={}),t.Workbook.Sheets||(t.Workbook.Sheets=[]);var r=$te(t,e);switch(t.Workbook.Sheets[r]||(t.Workbook.Sheets[r]={}),n){case 0:case 1:case 2:break;default:throw new Error("Bad sheet visibility setting "+n)}t.Workbook.Sheets[r].Hidden=n}function Xte(t,e){return t.z=e,t}function c3(t,e,n){return e?(t.l={Target:e},n&&(t.l.Tooltip=n)):delete t.l,t}function Qte(t,e,n){return c3(t,"#"+e,n)}function Zte(t,e,n){t.c||(t.c=[]),t.c.push({t:e,a:n||"SheetJS"})}function ene(t,e,n,r){for(var a=typeof e!="string"?e:Ct(e),i=typeof e=="string"?e:Kt(e),s=a.s.r;s<=a.e.r;++s)for(var o=a.s.c;o<=a.e.c;++o){var l=qd(t,s,o);l.t="n",l.F=i,delete l.v,s==a.s.r&&o==a.s.c&&(l.f=n,r&&(l.D=!0))}return t}var mv={encode_col:Un,encode_row:Cn,encode_cell:ht,encode_range:Kt,decode_col:wb,decode_row:Tb,split_cell:gJ,decode_cell:dn,decode_range:Rr,format_cell:mi,sheet_add_aoa:cO,sheet_add_json:u3,sheet_add_dom:r3,aoa_to_sheet:Pu,json_to_sheet:Wte,table_to_sheet:a3,table_to_book:wte,sheet_to_csv:Db,sheet_to_txt:l3,sheet_to_json:b0,sheet_to_html:n3,sheet_to_formulae:Hte,sheet_to_row_object_array:b0,sheet_get_cell:qd,book_new:Kte,book_append_sheet:Jte,book_set_sheet_visibility:Yte,cell_set_number_format:Xte,cell_set_hyperlink:c3,cell_set_internal_link:Qte,cell_add_comment:Zte,sheet_set_array_formula:ene,consts:{SHEET_VISIBLE:0,SHEET_HIDDEN:1,SHEET_VERY_HIDDEN:2}},d3={exports:{}};(function(t,e){(function(n,r){r()})(Wu,function(){function n(u,c){return typeof c>"u"?c={autoBom:!1}:typeof c!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),c={autoBom:!c}),c.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(u.type)?new Blob(["\uFEFF",u],{type:u.type}):u}function r(u,c,h){var f=new XMLHttpRequest;f.open("GET",u),f.responseType="blob",f.onload=function(){l(f.response,c,h)},f.onerror=function(){console.error("could not download file")},f.send()}function a(u){var c=new XMLHttpRequest;c.open("HEAD",u,!1);try{c.send()}catch{}return 200<=c.status&&299>=c.status}function i(u){try{u.dispatchEvent(new MouseEvent("click"))}catch{var c=document.createEvent("MouseEvents");c.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),u.dispatchEvent(c)}}var s=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof Wu=="object"&&Wu.global===Wu?Wu:void 0,o=s.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),l=s.saveAs||(typeof window!="object"||window!==s?function(){}:"download"in HTMLAnchorElement.prototype&&!o?function(u,c,h){var f=s.URL||s.webkitURL,p=document.createElement("a");c=c||u.name||"download",p.download=c,p.rel="noopener",typeof u=="string"?(p.href=u,p.origin===location.origin?i(p):a(p.href)?r(u,c,h):i(p,p.target="_blank")):(p.href=f.createObjectURL(u),setTimeout(function(){f.revokeObjectURL(p.href)},4e4),setTimeout(function(){i(p)},0))}:"msSaveOrOpenBlob"in navigator?function(u,c,h){if(c=c||u.name||"download",typeof u!="string")navigator.msSaveOrOpenBlob(n(u,h),c);else if(a(u))r(u,c,h);else{var f=document.createElement("a");f.href=u,f.target="_blank",setTimeout(function(){i(f)})}}:function(u,c,h,f){if(f=f||open("","_blank"),f&&(f.document.title=f.document.body.innerText="downloading..."),typeof u=="string")return r(u,c,h);var p=u.type==="application/octet-stream",g=/constructor/i.test(s.HTMLElement)||s.safari,m=/CriOS\/[\d]+/.test(navigator.userAgent);if((m||p&&g||o)&&typeof FileReader<"u"){var _=new FileReader;_.onloadend=function(){var y=_.result;y=m?y:y.replace(/^data:[^;]*;/,"data:attachment/file;"),f?f.location.href=y:location=y,f=null},_.readAsDataURL(u)}else{var x=s.URL||s.webkitURL,E=x.createObjectURL(u);f?f.location=E:location.href=E,f=null,setTimeout(function(){x.revokeObjectURL(E)},4e4)}});s.saveAs=l.saveAs=l,t.exports=l})})(d3);var tne=d3.exports;const h3=()=>Math.floor(1e5+Math.random()*9e5),nne=async t=>{const e=h3(),n=Ql(su,"token");try{return await wR(n,e),t&&t(e),e}catch(r){Ie.error(r),console.log("Error adding token: ",r)}},rne=async t=>{const e=[],n=Ql(su,"token");t(!0);try{for(let o=0;o<100;o++){const l=h3();e.push(l),await wR(n,l)}const r=mv.json_to_sheet(e.map(o=>({token:o}))),a=mv.book_new();mv.book_append_sheet(a,r,"Tokens");const i=o3(a,{bookType:"xlsx",type:"array"}),s=new Blob([i],{type:"application/octet-stream"});tne.saveAs(s,"tokens.xlsx"),t(!1),Ie.success("Tokens generados y exportados correctamente.")}catch(r){t(!1),Ie.error("Error al generar o guardar tokens."),console.error("Error:",r)}},Fb=()=>{const t=new Date().getTime(),e=12096e5,{payDay:[n]}=X.useContext(yi),r=new Date(n).toLocaleDateString("es-ES"),a=t>n-e;return O.jsx(O.Fragment,{children:a&&O.jsxs("div",{className:"pay-banner",children:[Cq," ",r,"."]})})},ane=()=>{const[t,e]=X.useState(null),[n,r]=X.useState(!1);return O.jsx(mb,{children:O.jsxs(O.Fragment,{children:[O.jsx(Fb,{}),n?O.jsx(ca,{isValidation:!0}):O.jsxs(O.Fragment,{children:[O.jsxs("div",{className:"token-container",children:[t&&O.jsx("p",{children:t}),O.jsx("button",{type:"button",onClick:()=>nne(e),className:"btn btn-warning",children:Zz}),O.jsx("button",{type:"button",onClick:()=>rne(r),className:"btn btn-danger mt-5",children:eq})]}),O.jsx(Tm,{})]})]})})},ine=()=>{const t=G0(),[e,n]=X.useState(!0),[r,a]=X.useState(null),[i,s]=X.useState(null),[o,l]=X.useState(!1),{email:[u]}=X.useContext(yi);return X.useEffect(()=>{if(u)for(const c of wm){const{deparment:h,emails:f}=c;f.includes(u)&&t(h,{replace:!0})}else u===!1&&n(!1)},[u]),O.jsx(O.Fragment,{children:e?O.jsx(ca,{isValidation:!0}):O.jsx(pb,{children:O.jsxs("form",{className:"sign-in-container",onSubmit:c=>dK(c,t,r,i),children:[O.jsx("div",{children:O.jsx("input",{placeholder:"Email",type:"email",onChange:c=>a(c.target.value)})}),O.jsxs("div",{children:[O.jsx("input",{placeholder:"Contraseña",type:o?"text":"password",onChange:c=>s(c.target.value)}),O.jsx(Bo,{className:"password-show",icon:o?hW:dW,onClick:()=>l(c=>!c)})]}),O.jsx("button",{className:"btn btn-success",children:_q})]})})})},sne=["primer_nombre","segundo_nombre","primer_apellido","segundo_apellido","profesion_ocupacion","nombre_padre","nombre_madre","firstName","lastName","institution","estado_residencia","ciudad_residencia","other_nationality"],one=["alojamiento","motivo_viaje","direccion_vzla","length_venezuela","family_venezuela","last_5"],lne=["hora_llegada"],une=["aeropuerto_salida","ruta_viaje_ida","ruta_viaje_retorno"],cne=["numero_vuelo_retorno","numero_vuelo_ida","aerolinea_retorno","aerolineas_ida"],dne=["aeropuerto_entrada"],hne=["email","correo_electronico"],fne=["telefono","telefono_emergencia","personal_phone","celular"],pne=["pasaporte","numero_pasaporte_vencido","numero_pasaporte"],mne=(t,e,n)=>{for(const r of t){if(r.name==="ciudad_nacimiento"&&n.estado_nacimiento==="Extranjero de Madre y/o Padre Venezolano"||e.includes(r.name))continue;const a=n[r.name];if(!a)return Ie.error(`Falta: ${r.placeholder}`),!1;const i=[{condition:["numero_planilla"].includes(r.name),regex:/^[A-Za-z0-9]{5}$/,errorMessage:`El campo ${r.placeholder} debe contener solo 5 caracteres`},{condition:sne.includes(r.name),regex:/^[A-Za-zñÑ\s]+$/,errorMessage:`El campo ${r.placeholder} no debe contener caracteres especiales o números`},{condition:["cedula"].includes(r.name),regex:/^\d{6,8}$/,errorMessage:`El campo ${r.placeholder} está incorrecto, debe contener solo de 6 a 8 caracteres numéricos`},{condition:pne.includes(r.name),regex:/^[a-zA-Z0-9]{5,14}$/,errorMessage:`El campo ${r.placeholder} solo permite de 5 a 14 caracteres alfanúmericos`},{condition:fne.includes(r.name),regex:/^\+\d{1,3}\s\d{10,15}$/,errorMessage:`El campo ${r.placeholder} debe contener un "+" con código de área, un espacio y entre 10 a 15 números. - Ej.: +58 4146526335`},{condition:hne.includes(r.name),regex:/^[^\s@]+@[^\s@]+\.[^\s@]+$/,errorMessage:`El campo ${r.placeholder} debe ser un email válido`},{condition:une.includes(r.name),regex:/^\s*([A-Za-z]{3})( \/ [A-Za-z]{3})*\s*$/,errorMessage:`El campo ${r.placeholder} debe ser igual al ejemplo, solo en código IATA - Ej.: MCO / CCS`},{condition:cne.includes(r.name),regex:/^[A-Za-z0-9]+(?: \/ [A-Za-z0-9]+)*$/,errorMessage:`El campo ${r.placeholder} debe ser igual al ejemplo, no permite espacios si es VIVA AEROBUS o AMERICAN AIRLINES, solo colocar - Ej.: VIVA / AMERICAN`},{condition:one.includes(r.name),regex:/^[A-Za-z0-9 ñÑ\-/,]*$/,errorMessage:`El campo ${r.placeholder} solo puede contener letras, numeros, "-", "/", ","`},{condition:["address"].includes(r.name),regex:/^[a-zA-Z0-9ñÑ][a-zA-Z0-9ñÑ\- /]*[a-zA-Z0-9ñÑ], [cC][pP] [a-zA-Z0-9ñÑ]{4,9}, [a-zA-Z0-9ñÑ][a-zA-Z0-9ñÑ\- ]*[a-zA-Z0-9ñÑ], [a-zA-Z0-9ñÑ][a-zA-Z0-9ñÑ\- ]*[a-zA-Z0-9ñÑ]$/,errorMessage:`El campo ${r.placeholder} debe contener exactamente 4 segmentos, segmentos separados por comas, y cada segmento debe comenzar y terminar con un carácter alfanumérico, asimismo el segundo segmento debe contener CP, ¡Ver ejemplo!`},{condition:lne.includes(r.name),regex:/^([01]\d|2[0-3]):([0-5]\d)$/,errorMessage:`El campo ${r.placeholder} debe ser igual al ejemplo, incluir ":" y sin AM o PM - Ej.: 23:00`},{condition:dne.includes(r.name),regex:/^[A-Za-z]{3}$/,errorMessage:`El campo ${r.placeholder} debe ser igual al ejemplo, solo en código IATA - Ej.: MCO`}];for(const{condition:s,regex:o,errorMessage:l}of i)if(s&&!o.test(a))return Ie.error(l),!1}return!0};var vn=[];for(var gv=0;gv<256;++gv)vn.push((gv+256).toString(16).slice(1));function gne(t,e=0){return(vn[t[e+0]]+vn[t[e+1]]+vn[t[e+2]]+vn[t[e+3]]+"-"+vn[t[e+4]]+vn[t[e+5]]+"-"+vn[t[e+6]]+vn[t[e+7]]+"-"+vn[t[e+8]]+vn[t[e+9]]+"-"+vn[t[e+10]]+vn[t[e+11]]+vn[t[e+12]]+vn[t[e+13]]+vn[t[e+14]]+vn[t[e+15]]).toLowerCase()}var wf,vne=new Uint8Array(16);function _ne(){if(!wf&&(wf=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!wf))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return wf(vne)}var yne=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);const dC={randomUUID:yne};function hC(t,e,n){if(dC.randomUUID&&!e&&!t)return dC.randomUUID();t=t||{};var r=t.random||(t.rng||_ne)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,gne(r)}const f3=["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre"],x0=t=>{const[e]=t.split(" "),[n,r,a]=e.split("-").map(Number),i=new Date(n,r-1,a),s=i.getDate(),o=f3[i.getMonth()],l=i.getFullYear();return`${s} de ${o} de ${l}`},Gm=t=>{const e=new Date,n={timeZone:"America/Mexico_City",hour12:!1},r=e.toLocaleString("en-US",n),a=new Date(r),i=a.getFullYear(),s=String(a.getMonth()+1).padStart(2,"0"),o=String(a.getDate()).padStart(2,"0"),l=String(a.getHours()).padStart(2,"0"),u=String(a.getMinutes()).padStart(2,"0");return t?`${i}-${s}-${o} ${l}:${u}`:`${i}-${s}-${o}`},Ene=t=>{const[e,n,r]=t.split("/"),a=parseInt(e,10),i=f3[parseInt(n,10)-1];return`${a} de ${i} de ${r}`},bne=t=>{const[e,n,r]=t.split("/");return new Date(`${r}-${n}-${e}`).getTime()};var xne="rpc",Sne="upload",Tne="download",vv="app",_v="user",yv="team",wne="noauth",Cne="cookie",S0="dropboxapi.com",fC="dropbox.com",R_={api:"api",notify:"bolt",content:"api-content"},B={};B.accountSetProfilePhoto=function(t){return this.request("account/set_profile_photo",t,"user","api","rpc","account_info.write")};B.authTokenFromOauth1=function(t){return this.request("auth/token/from_oauth1",t,"app","api","rpc",null)};B.authTokenRevoke=function(){return this.request("auth/token/revoke",null,"user","api","rpc",null)};B.checkApp=function(t){return this.request("check/app",t,"app","api","rpc",null)};B.checkUser=function(t){return this.request("check/user",t,"user","api","rpc","account_info.read")};B.contactsDeleteManualContacts=function(){return this.request("contacts/delete_manual_contacts",null,"user","api","rpc","contacts.write")};B.contactsDeleteManualContactsBatch=function(t){return this.request("contacts/delete_manual_contacts_batch",t,"user","api","rpc","contacts.write")};B.filePropertiesPropertiesAdd=function(t){return this.request("file_properties/properties/add",t,"user","api","rpc","files.metadata.write")};B.filePropertiesPropertiesOverwrite=function(t){return this.request("file_properties/properties/overwrite",t,"user","api","rpc","files.metadata.write")};B.filePropertiesPropertiesRemove=function(t){return this.request("file_properties/properties/remove",t,"user","api","rpc","files.metadata.write")};B.filePropertiesPropertiesSearch=function(t){return this.request("file_properties/properties/search",t,"user","api","rpc","files.metadata.read")};B.filePropertiesPropertiesSearchContinue=function(t){return this.request("file_properties/properties/search/continue",t,"user","api","rpc","files.metadata.read")};B.filePropertiesPropertiesUpdate=function(t){return this.request("file_properties/properties/update",t,"user","api","rpc","files.metadata.write")};B.filePropertiesTemplatesAddForTeam=function(t){return this.request("file_properties/templates/add_for_team",t,"team","api","rpc","files.team_metadata.write")};B.filePropertiesTemplatesAddForUser=function(t){return this.request("file_properties/templates/add_for_user",t,"user","api","rpc","files.metadata.write")};B.filePropertiesTemplatesGetForTeam=function(t){return this.request("file_properties/templates/get_for_team",t,"team","api","rpc","files.team_metadata.write")};B.filePropertiesTemplatesGetForUser=function(t){return this.request("file_properties/templates/get_for_user",t,"user","api","rpc","files.metadata.read")};B.filePropertiesTemplatesListForTeam=function(){return this.request("file_properties/templates/list_for_team",null,"team","api","rpc","files.team_metadata.write")};B.filePropertiesTemplatesListForUser=function(){return this.request("file_properties/templates/list_for_user",null,"user","api","rpc","files.metadata.read")};B.filePropertiesTemplatesRemoveForTeam=function(t){return this.request("file_properties/templates/remove_for_team",t,"team","api","rpc","files.team_metadata.write")};B.filePropertiesTemplatesRemoveForUser=function(t){return this.request("file_properties/templates/remove_for_user",t,"user","api","rpc","files.metadata.write")};B.filePropertiesTemplatesUpdateForTeam=function(t){return this.request("file_properties/templates/update_for_team",t,"team","api","rpc","files.team_metadata.write")};B.filePropertiesTemplatesUpdateForUser=function(t){return this.request("file_properties/templates/update_for_user",t,"user","api","rpc","files.metadata.write")};B.fileRequestsCount=function(){return this.request("file_requests/count",null,"user","api","rpc","file_requests.read")};B.fileRequestsCreate=function(t){return this.request("file_requests/create",t,"user","api","rpc","file_requests.write")};B.fileRequestsDelete=function(t){return this.request("file_requests/delete",t,"user","api","rpc","file_requests.write")};B.fileRequestsDeleteAllClosed=function(){return this.request("file_requests/delete_all_closed",null,"user","api","rpc","file_requests.write")};B.fileRequestsGet=function(t){return this.request("file_requests/get",t,"user","api","rpc","file_requests.read")};B.fileRequestsListV2=function(t){return this.request("file_requests/list_v2",t,"user","api","rpc","file_requests.read")};B.fileRequestsList=function(){return this.request("file_requests/list",null,"user","api","rpc","file_requests.read")};B.fileRequestsListContinue=function(t){return this.request("file_requests/list/continue",t,"user","api","rpc","file_requests.read")};B.fileRequestsUpdate=function(t){return this.request("file_requests/update",t,"user","api","rpc","file_requests.write")};B.filesAlphaGetMetadata=function(t){return this.request("files/alpha/get_metadata",t,"user","api","rpc","files.metadata.read")};B.filesAlphaUpload=function(t){return this.request("files/alpha/upload",t,"user","content","upload","files.content.write")};B.filesCopyV2=function(t){return this.request("files/copy_v2",t,"user","api","rpc","files.content.write")};B.filesCopy=function(t){return this.request("files/copy",t,"user","api","rpc","files.content.write")};B.filesCopyBatchV2=function(t){return this.request("files/copy_batch_v2",t,"user","api","rpc","files.content.write")};B.filesCopyBatch=function(t){return this.request("files/copy_batch",t,"user","api","rpc","files.content.write")};B.filesCopyBatchCheckV2=function(t){return this.request("files/copy_batch/check_v2",t,"user","api","rpc","files.content.write")};B.filesCopyBatchCheck=function(t){return this.request("files/copy_batch/check",t,"user","api","rpc","files.content.write")};B.filesCopyReferenceGet=function(t){return this.request("files/copy_reference/get",t,"user","api","rpc","files.content.write")};B.filesCopyReferenceSave=function(t){return this.request("files/copy_reference/save",t,"user","api","rpc","files.content.write")};B.filesCreateFolderV2=function(t){return this.request("files/create_folder_v2",t,"user","api","rpc","files.content.write")};B.filesCreateFolder=function(t){return this.request("files/create_folder",t,"user","api","rpc","files.content.write")};B.filesCreateFolderBatch=function(t){return this.request("files/create_folder_batch",t,"user","api","rpc","files.content.write")};B.filesCreateFolderBatchCheck=function(t){return this.request("files/create_folder_batch/check",t,"user","api","rpc","files.content.write")};B.filesDeleteV2=function(t){return this.request("files/delete_v2",t,"user","api","rpc","files.content.write")};B.filesDelete=function(t){return this.request("files/delete",t,"user","api","rpc","files.content.write")};B.filesDeleteBatch=function(t){return this.request("files/delete_batch",t,"user","api","rpc","files.content.write")};B.filesDeleteBatchCheck=function(t){return this.request("files/delete_batch/check",t,"user","api","rpc","files.content.write")};B.filesDownload=function(t){return this.request("files/download",t,"user","content","download","files.content.read")};B.filesDownloadZip=function(t){return this.request("files/download_zip",t,"user","content","download","files.content.read")};B.filesExport=function(t){return this.request("files/export",t,"user","content","download","files.content.read")};B.filesGetFileLockBatch=function(t){return this.request("files/get_file_lock_batch",t,"user","api","rpc","files.content.read")};B.filesGetMetadata=function(t){return this.request("files/get_metadata",t,"user","api","rpc","files.metadata.read")};B.filesGetPreview=function(t){return this.request("files/get_preview",t,"user","content","download","files.content.read")};B.filesGetTemporaryLink=function(t){return this.request("files/get_temporary_link",t,"user","api","rpc","files.content.read")};B.filesGetTemporaryUploadLink=function(t){return this.request("files/get_temporary_upload_link",t,"user","api","rpc","files.content.write")};B.filesGetThumbnail=function(t){return this.request("files/get_thumbnail",t,"user","content","download","files.content.read")};B.filesGetThumbnailV2=function(t){return this.request("files/get_thumbnail_v2",t,"app, user","content","download","files.content.read")};B.filesGetThumbnailBatch=function(t){return this.request("files/get_thumbnail_batch",t,"user","content","rpc","files.content.read")};B.filesListFolder=function(t){return this.request("files/list_folder",t,"app, user","api","rpc","files.metadata.read")};B.filesListFolderContinue=function(t){return this.request("files/list_folder/continue",t,"app, user","api","rpc","files.metadata.read")};B.filesListFolderGetLatestCursor=function(t){return this.request("files/list_folder/get_latest_cursor",t,"user","api","rpc","files.metadata.read")};B.filesListFolderLongpoll=function(t){return this.request("files/list_folder/longpoll",t,"noauth","notify","rpc","files.metadata.read")};B.filesListRevisions=function(t){return this.request("files/list_revisions",t,"user","api","rpc","files.metadata.read")};B.filesLockFileBatch=function(t){return this.request("files/lock_file_batch",t,"user","api","rpc","files.content.write")};B.filesMoveV2=function(t){return this.request("files/move_v2",t,"user","api","rpc","files.content.write")};B.filesMove=function(t){return this.request("files/move",t,"user","api","rpc","files.content.write")};B.filesMoveBatchV2=function(t){return this.request("files/move_batch_v2",t,"user","api","rpc","files.content.write")};B.filesMoveBatch=function(t){return this.request("files/move_batch",t,"user","api","rpc","files.content.write")};B.filesMoveBatchCheckV2=function(t){return this.request("files/move_batch/check_v2",t,"user","api","rpc","files.content.write")};B.filesMoveBatchCheck=function(t){return this.request("files/move_batch/check",t,"user","api","rpc","files.content.write")};B.filesPaperCreate=function(t){return this.request("files/paper/create",t,"user","api","upload","files.content.write")};B.filesPaperUpdate=function(t){return this.request("files/paper/update",t,"user","api","upload","files.content.write")};B.filesPermanentlyDelete=function(t){return this.request("files/permanently_delete",t,"user","api","rpc","files.permanent_delete")};B.filesPropertiesAdd=function(t){return this.request("files/properties/add",t,"user","api","rpc","files.metadata.write")};B.filesPropertiesOverwrite=function(t){return this.request("files/properties/overwrite",t,"user","api","rpc","files.metadata.write")};B.filesPropertiesRemove=function(t){return this.request("files/properties/remove",t,"user","api","rpc","files.metadata.write")};B.filesPropertiesTemplateGet=function(t){return this.request("files/properties/template/get",t,"user","api","rpc","files.metadata.read")};B.filesPropertiesTemplateList=function(){return this.request("files/properties/template/list",null,"user","api","rpc","files.metadata.read")};B.filesPropertiesUpdate=function(t){return this.request("files/properties/update",t,"user","api","rpc","files.metadata.write")};B.filesRestore=function(t){return this.request("files/restore",t,"user","api","rpc","files.content.write")};B.filesSaveUrl=function(t){return this.request("files/save_url",t,"user","api","rpc","files.content.write")};B.filesSaveUrlCheckJobStatus=function(t){return this.request("files/save_url/check_job_status",t,"user","api","rpc","files.content.write")};B.filesSearch=function(t){return this.request("files/search",t,"user","api","rpc","files.metadata.read")};B.filesSearchV2=function(t){return this.request("files/search_v2",t,"user","api","rpc","files.metadata.read")};B.filesSearchContinueV2=function(t){return this.request("files/search/continue_v2",t,"user","api","rpc","files.metadata.read")};B.filesTagsAdd=function(t){return this.request("files/tags/add",t,"user","api","rpc","files.metadata.write")};B.filesTagsGet=function(t){return this.request("files/tags/get",t,"user","api","rpc","files.metadata.read")};B.filesTagsRemove=function(t){return this.request("files/tags/remove",t,"user","api","rpc","files.metadata.write")};B.filesUnlockFileBatch=function(t){return this.request("files/unlock_file_batch",t,"user","api","rpc","files.content.write")};B.filesUpload=function(t){return this.request("files/upload",t,"user","content","upload","files.content.write")};B.filesUploadSessionAppendV2=function(t){return this.request("files/upload_session/append_v2",t,"user","content","upload","files.content.write")};B.filesUploadSessionAppend=function(t){return this.request("files/upload_session/append",t,"user","content","upload","files.content.write")};B.filesUploadSessionFinish=function(t){return this.request("files/upload_session/finish",t,"user","content","upload","files.content.write")};B.filesUploadSessionFinishBatch=function(t){return this.request("files/upload_session/finish_batch",t,"user","api","rpc","files.content.write")};B.filesUploadSessionFinishBatchV2=function(t){return this.request("files/upload_session/finish_batch_v2",t,"user","api","rpc","files.content.write")};B.filesUploadSessionFinishBatchCheck=function(t){return this.request("files/upload_session/finish_batch/check",t,"user","api","rpc","files.content.write")};B.filesUploadSessionStart=function(t){return this.request("files/upload_session/start",t,"user","content","upload","files.content.write")};B.filesUploadSessionStartBatch=function(t){return this.request("files/upload_session/start_batch",t,"user","api","rpc","files.content.write")};B.openidUserinfo=function(t){return this.request("openid/userinfo",t,"user","api","rpc","openid")};B.paperDocsArchive=function(t){return this.request("paper/docs/archive",t,"user","api","rpc","files.content.write")};B.paperDocsCreate=function(t){return this.request("paper/docs/create",t,"user","api","upload","files.content.write")};B.paperDocsDownload=function(t){return this.request("paper/docs/download",t,"user","api","download","files.content.read")};B.paperDocsFolderUsersList=function(t){return this.request("paper/docs/folder_users/list",t,"user","api","rpc","sharing.read")};B.paperDocsFolderUsersListContinue=function(t){return this.request("paper/docs/folder_users/list/continue",t,"user","api","rpc","sharing.read")};B.paperDocsGetFolderInfo=function(t){return this.request("paper/docs/get_folder_info",t,"user","api","rpc","sharing.read")};B.paperDocsList=function(t){return this.request("paper/docs/list",t,"user","api","rpc","files.metadata.read")};B.paperDocsListContinue=function(t){return this.request("paper/docs/list/continue",t,"user","api","rpc","files.metadata.read")};B.paperDocsPermanentlyDelete=function(t){return this.request("paper/docs/permanently_delete",t,"user","api","rpc","files.permanent_delete")};B.paperDocsSharingPolicyGet=function(t){return this.request("paper/docs/sharing_policy/get",t,"user","api","rpc","sharing.read")};B.paperDocsSharingPolicySet=function(t){return this.request("paper/docs/sharing_policy/set",t,"user","api","rpc","sharing.write")};B.paperDocsUpdate=function(t){return this.request("paper/docs/update",t,"user","api","upload","files.content.write")};B.paperDocsUsersAdd=function(t){return this.request("paper/docs/users/add",t,"user","api","rpc","sharing.write")};B.paperDocsUsersList=function(t){return this.request("paper/docs/users/list",t,"user","api","rpc","sharing.read")};B.paperDocsUsersListContinue=function(t){return this.request("paper/docs/users/list/continue",t,"user","api","rpc","sharing.read")};B.paperDocsUsersRemove=function(t){return this.request("paper/docs/users/remove",t,"user","api","rpc","sharing.write")};B.paperFoldersCreate=function(t){return this.request("paper/folders/create",t,"user","api","rpc","files.content.write")};B.sharingAddFileMember=function(t){return this.request("sharing/add_file_member",t,"user","api","rpc","sharing.write")};B.sharingAddFolderMember=function(t){return this.request("sharing/add_folder_member",t,"user","api","rpc","sharing.write")};B.sharingCheckJobStatus=function(t){return this.request("sharing/check_job_status",t,"user","api","rpc","sharing.write")};B.sharingCheckRemoveMemberJobStatus=function(t){return this.request("sharing/check_remove_member_job_status",t,"user","api","rpc","sharing.write")};B.sharingCheckShareJobStatus=function(t){return this.request("sharing/check_share_job_status",t,"user","api","rpc","sharing.write")};B.sharingCreateSharedLink=function(t){return this.request("sharing/create_shared_link",t,"user","api","rpc","sharing.write")};B.sharingCreateSharedLinkWithSettings=function(t){return this.request("sharing/create_shared_link_with_settings",t,"user","api","rpc","sharing.write")};B.sharingGetFileMetadata=function(t){return this.request("sharing/get_file_metadata",t,"user","api","rpc","sharing.read")};B.sharingGetFileMetadataBatch=function(t){return this.request("sharing/get_file_metadata/batch",t,"user","api","rpc","sharing.read")};B.sharingGetFolderMetadata=function(t){return this.request("sharing/get_folder_metadata",t,"user","api","rpc","sharing.read")};B.sharingGetSharedLinkFile=function(t){return this.request("sharing/get_shared_link_file",t,"user","content","download","sharing.read")};B.sharingGetSharedLinkMetadata=function(t){return this.request("sharing/get_shared_link_metadata",t,"app, user","api","rpc","sharing.read")};B.sharingGetSharedLinks=function(t){return this.request("sharing/get_shared_links",t,"user","api","rpc","sharing.read")};B.sharingListFileMembers=function(t){return this.request("sharing/list_file_members",t,"user","api","rpc","sharing.read")};B.sharingListFileMembersBatch=function(t){return this.request("sharing/list_file_members/batch",t,"user","api","rpc","sharing.read")};B.sharingListFileMembersContinue=function(t){return this.request("sharing/list_file_members/continue",t,"user","api","rpc","sharing.read")};B.sharingListFolderMembers=function(t){return this.request("sharing/list_folder_members",t,"user","api","rpc","sharing.read")};B.sharingListFolderMembersContinue=function(t){return this.request("sharing/list_folder_members/continue",t,"user","api","rpc","sharing.read")};B.sharingListFolders=function(t){return this.request("sharing/list_folders",t,"user","api","rpc","sharing.read")};B.sharingListFoldersContinue=function(t){return this.request("sharing/list_folders/continue",t,"user","api","rpc","sharing.read")};B.sharingListMountableFolders=function(t){return this.request("sharing/list_mountable_folders",t,"user","api","rpc","sharing.read")};B.sharingListMountableFoldersContinue=function(t){return this.request("sharing/list_mountable_folders/continue",t,"user","api","rpc","sharing.read")};B.sharingListReceivedFiles=function(t){return this.request("sharing/list_received_files",t,"user","api","rpc","sharing.read")};B.sharingListReceivedFilesContinue=function(t){return this.request("sharing/list_received_files/continue",t,"user","api","rpc","sharing.read")};B.sharingListSharedLinks=function(t){return this.request("sharing/list_shared_links",t,"user","api","rpc","sharing.read")};B.sharingModifySharedLinkSettings=function(t){return this.request("sharing/modify_shared_link_settings",t,"user","api","rpc","sharing.write")};B.sharingMountFolder=function(t){return this.request("sharing/mount_folder",t,"user","api","rpc","sharing.write")};B.sharingRelinquishFileMembership=function(t){return this.request("sharing/relinquish_file_membership",t,"user","api","rpc","sharing.write")};B.sharingRelinquishFolderMembership=function(t){return this.request("sharing/relinquish_folder_membership",t,"user","api","rpc","sharing.write")};B.sharingRemoveFileMember=function(t){return this.request("sharing/remove_file_member",t,"user","api","rpc","sharing.write")};B.sharingRemoveFileMember2=function(t){return this.request("sharing/remove_file_member_2",t,"user","api","rpc","sharing.write")};B.sharingRemoveFolderMember=function(t){return this.request("sharing/remove_folder_member",t,"user","api","rpc","sharing.write")};B.sharingRevokeSharedLink=function(t){return this.request("sharing/revoke_shared_link",t,"user","api","rpc","sharing.write")};B.sharingSetAccessInheritance=function(t){return this.request("sharing/set_access_inheritance",t,"user","api","rpc","sharing.write")};B.sharingShareFolder=function(t){return this.request("sharing/share_folder",t,"user","api","rpc","sharing.write")};B.sharingTransferFolder=function(t){return this.request("sharing/transfer_folder",t,"user","api","rpc","sharing.write")};B.sharingUnmountFolder=function(t){return this.request("sharing/unmount_folder",t,"user","api","rpc","sharing.write")};B.sharingUnshareFile=function(t){return this.request("sharing/unshare_file",t,"user","api","rpc","sharing.write")};B.sharingUnshareFolder=function(t){return this.request("sharing/unshare_folder",t,"user","api","rpc","sharing.write")};B.sharingUpdateFileMember=function(t){return this.request("sharing/update_file_member",t,"user","api","rpc","sharing.write")};B.sharingUpdateFolderMember=function(t){return this.request("sharing/update_folder_member",t,"user","api","rpc","sharing.write")};B.sharingUpdateFolderPolicy=function(t){return this.request("sharing/update_folder_policy",t,"user","api","rpc","sharing.write")};B.teamDevicesListMemberDevices=function(t){return this.request("team/devices/list_member_devices",t,"team","api","rpc","sessions.list")};B.teamDevicesListMembersDevices=function(t){return this.request("team/devices/list_members_devices",t,"team","api","rpc","sessions.list")};B.teamDevicesListTeamDevices=function(t){return this.request("team/devices/list_team_devices",t,"team","api","rpc","sessions.list")};B.teamDevicesRevokeDeviceSession=function(t){return this.request("team/devices/revoke_device_session",t,"team","api","rpc","sessions.modify")};B.teamDevicesRevokeDeviceSessionBatch=function(t){return this.request("team/devices/revoke_device_session_batch",t,"team","api","rpc","sessions.modify")};B.teamFeaturesGetValues=function(t){return this.request("team/features/get_values",t,"team","api","rpc","team_info.read")};B.teamGetInfo=function(){return this.request("team/get_info",null,"team","api","rpc","team_info.read")};B.teamGroupsCreate=function(t){return this.request("team/groups/create",t,"team","api","rpc","groups.write")};B.teamGroupsDelete=function(t){return this.request("team/groups/delete",t,"team","api","rpc","groups.write")};B.teamGroupsGetInfo=function(t){return this.request("team/groups/get_info",t,"team","api","rpc","groups.read")};B.teamGroupsJobStatusGet=function(t){return this.request("team/groups/job_status/get",t,"team","api","rpc","groups.write")};B.teamGroupsList=function(t){return this.request("team/groups/list",t,"team","api","rpc","groups.read")};B.teamGroupsListContinue=function(t){return this.request("team/groups/list/continue",t,"team","api","rpc","groups.read")};B.teamGroupsMembersAdd=function(t){return this.request("team/groups/members/add",t,"team","api","rpc","groups.write")};B.teamGroupsMembersList=function(t){return this.request("team/groups/members/list",t,"team","api","rpc","groups.read")};B.teamGroupsMembersListContinue=function(t){return this.request("team/groups/members/list/continue",t,"team","api","rpc","groups.read")};B.teamGroupsMembersRemove=function(t){return this.request("team/groups/members/remove",t,"team","api","rpc","groups.write")};B.teamGroupsMembersSetAccessType=function(t){return this.request("team/groups/members/set_access_type",t,"team","api","rpc","groups.write")};B.teamGroupsUpdate=function(t){return this.request("team/groups/update",t,"team","api","rpc","groups.write")};B.teamLegalHoldsCreatePolicy=function(t){return this.request("team/legal_holds/create_policy",t,"team","api","rpc","team_data.governance.write")};B.teamLegalHoldsGetPolicy=function(t){return this.request("team/legal_holds/get_policy",t,"team","api","rpc","team_data.governance.write")};B.teamLegalHoldsListHeldRevisions=function(t){return this.request("team/legal_holds/list_held_revisions",t,"team","api","rpc","team_data.governance.write")};B.teamLegalHoldsListHeldRevisionsContinue=function(t){return this.request("team/legal_holds/list_held_revisions_continue",t,"team","api","rpc","team_data.governance.write")};B.teamLegalHoldsListPolicies=function(t){return this.request("team/legal_holds/list_policies",t,"team","api","rpc","team_data.governance.write")};B.teamLegalHoldsReleasePolicy=function(t){return this.request("team/legal_holds/release_policy",t,"team","api","rpc","team_data.governance.write")};B.teamLegalHoldsUpdatePolicy=function(t){return this.request("team/legal_holds/update_policy",t,"team","api","rpc","team_data.governance.write")};B.teamLinkedAppsListMemberLinkedApps=function(t){return this.request("team/linked_apps/list_member_linked_apps",t,"team","api","rpc","sessions.list")};B.teamLinkedAppsListMembersLinkedApps=function(t){return this.request("team/linked_apps/list_members_linked_apps",t,"team","api","rpc","sessions.list")};B.teamLinkedAppsListTeamLinkedApps=function(t){return this.request("team/linked_apps/list_team_linked_apps",t,"team","api","rpc","sessions.list")};B.teamLinkedAppsRevokeLinkedApp=function(t){return this.request("team/linked_apps/revoke_linked_app",t,"team","api","rpc","sessions.modify")};B.teamLinkedAppsRevokeLinkedAppBatch=function(t){return this.request("team/linked_apps/revoke_linked_app_batch",t,"team","api","rpc","sessions.modify")};B.teamMemberSpaceLimitsExcludedUsersAdd=function(t){return this.request("team/member_space_limits/excluded_users/add",t,"team","api","rpc","members.write")};B.teamMemberSpaceLimitsExcludedUsersList=function(t){return this.request("team/member_space_limits/excluded_users/list",t,"team","api","rpc","members.read")};B.teamMemberSpaceLimitsExcludedUsersListContinue=function(t){return this.request("team/member_space_limits/excluded_users/list/continue",t,"team","api","rpc","members.read")};B.teamMemberSpaceLimitsExcludedUsersRemove=function(t){return this.request("team/member_space_limits/excluded_users/remove",t,"team","api","rpc","members.write")};B.teamMemberSpaceLimitsGetCustomQuota=function(t){return this.request("team/member_space_limits/get_custom_quota",t,"team","api","rpc","members.read")};B.teamMemberSpaceLimitsRemoveCustomQuota=function(t){return this.request("team/member_space_limits/remove_custom_quota",t,"team","api","rpc","members.write")};B.teamMemberSpaceLimitsSetCustomQuota=function(t){return this.request("team/member_space_limits/set_custom_quota",t,"team","api","rpc","members.read")};B.teamMembersAddV2=function(t){return this.request("team/members/add_v2",t,"team","api","rpc","members.write")};B.teamMembersAdd=function(t){return this.request("team/members/add",t,"team","api","rpc","members.write")};B.teamMembersAddJobStatusGetV2=function(t){return this.request("team/members/add/job_status/get_v2",t,"team","api","rpc","members.write")};B.teamMembersAddJobStatusGet=function(t){return this.request("team/members/add/job_status/get",t,"team","api","rpc","members.write")};B.teamMembersDeleteProfilePhotoV2=function(t){return this.request("team/members/delete_profile_photo_v2",t,"team","api","rpc","members.write")};B.teamMembersDeleteProfilePhoto=function(t){return this.request("team/members/delete_profile_photo",t,"team","api","rpc","members.write")};B.teamMembersGetAvailableTeamMemberRoles=function(){return this.request("team/members/get_available_team_member_roles",null,"team","api","rpc","members.read")};B.teamMembersGetInfoV2=function(t){return this.request("team/members/get_info_v2",t,"team","api","rpc","members.read")};B.teamMembersGetInfo=function(t){return this.request("team/members/get_info",t,"team","api","rpc","members.read")};B.teamMembersListV2=function(t){return this.request("team/members/list_v2",t,"team","api","rpc","members.read")};B.teamMembersList=function(t){return this.request("team/members/list",t,"team","api","rpc","members.read")};B.teamMembersListContinueV2=function(t){return this.request("team/members/list/continue_v2",t,"team","api","rpc","members.read")};B.teamMembersListContinue=function(t){return this.request("team/members/list/continue",t,"team","api","rpc","members.read")};B.teamMembersMoveFormerMemberFiles=function(t){return this.request("team/members/move_former_member_files",t,"team","api","rpc","members.write")};B.teamMembersMoveFormerMemberFilesJobStatusCheck=function(t){return this.request("team/members/move_former_member_files/job_status/check",t,"team","api","rpc","members.write")};B.teamMembersRecover=function(t){return this.request("team/members/recover",t,"team","api","rpc","members.delete")};B.teamMembersRemove=function(t){return this.request("team/members/remove",t,"team","api","rpc","members.delete")};B.teamMembersRemoveJobStatusGet=function(t){return this.request("team/members/remove/job_status/get",t,"team","api","rpc","members.delete")};B.teamMembersSecondaryEmailsAdd=function(t){return this.request("team/members/secondary_emails/add",t,"team","api","rpc","members.write")};B.teamMembersSecondaryEmailsDelete=function(t){return this.request("team/members/secondary_emails/delete",t,"team","api","rpc","members.write")};B.teamMembersSecondaryEmailsResendVerificationEmails=function(t){return this.request("team/members/secondary_emails/resend_verification_emails",t,"team","api","rpc","members.write")};B.teamMembersSendWelcomeEmail=function(t){return this.request("team/members/send_welcome_email",t,"team","api","rpc","members.write")};B.teamMembersSetAdminPermissionsV2=function(t){return this.request("team/members/set_admin_permissions_v2",t,"team","api","rpc","members.write")};B.teamMembersSetAdminPermissions=function(t){return this.request("team/members/set_admin_permissions",t,"team","api","rpc","members.write")};B.teamMembersSetProfileV2=function(t){return this.request("team/members/set_profile_v2",t,"team","api","rpc","members.write")};B.teamMembersSetProfile=function(t){return this.request("team/members/set_profile",t,"team","api","rpc","members.write")};B.teamMembersSetProfilePhotoV2=function(t){return this.request("team/members/set_profile_photo_v2",t,"team","api","rpc","members.write")};B.teamMembersSetProfilePhoto=function(t){return this.request("team/members/set_profile_photo",t,"team","api","rpc","members.write")};B.teamMembersSuspend=function(t){return this.request("team/members/suspend",t,"team","api","rpc","members.write")};B.teamMembersUnsuspend=function(t){return this.request("team/members/unsuspend",t,"team","api","rpc","members.write")};B.teamNamespacesList=function(t){return this.request("team/namespaces/list",t,"team","api","rpc","team_data.member")};B.teamNamespacesListContinue=function(t){return this.request("team/namespaces/list/continue",t,"team","api","rpc","team_data.member")};B.teamPropertiesTemplateAdd=function(t){return this.request("team/properties/template/add",t,"team","api","rpc","files.team_metadata.write")};B.teamPropertiesTemplateGet=function(t){return this.request("team/properties/template/get",t,"team","api","rpc","files.team_metadata.write")};B.teamPropertiesTemplateList=function(){return this.request("team/properties/template/list",null,"team","api","rpc","files.team_metadata.write")};B.teamPropertiesTemplateUpdate=function(t){return this.request("team/properties/template/update",t,"team","api","rpc","files.team_metadata.write")};B.teamReportsGetActivity=function(t){return this.request("team/reports/get_activity",t,"team","api","rpc","team_info.read")};B.teamReportsGetDevices=function(t){return this.request("team/reports/get_devices",t,"team","api","rpc","team_info.read")};B.teamReportsGetMembership=function(t){return this.request("team/reports/get_membership",t,"team","api","rpc","team_info.read")};B.teamReportsGetStorage=function(t){return this.request("team/reports/get_storage",t,"team","api","rpc","team_info.read")};B.teamSharingAllowlistAdd=function(t){return this.request("team/sharing_allowlist/add",t,"team","api","rpc","team_info.write")};B.teamSharingAllowlistList=function(t){return this.request("team/sharing_allowlist/list",t,"team","api","rpc","team_info.read")};B.teamSharingAllowlistListContinue=function(t){return this.request("team/sharing_allowlist/list/continue",t,"team","api","rpc","team_info.read")};B.teamSharingAllowlistRemove=function(t){return this.request("team/sharing_allowlist/remove",t,"team","api","rpc","team_info.write")};B.teamTeamFolderActivate=function(t){return this.request("team/team_folder/activate",t,"team","api","rpc","team_data.content.write")};B.teamTeamFolderArchive=function(t){return this.request("team/team_folder/archive",t,"team","api","rpc","team_data.content.write")};B.teamTeamFolderArchiveCheck=function(t){return this.request("team/team_folder/archive/check",t,"team","api","rpc","team_data.content.write")};B.teamTeamFolderCreate=function(t){return this.request("team/team_folder/create",t,"team","api","rpc","team_data.content.write")};B.teamTeamFolderGetInfo=function(t){return this.request("team/team_folder/get_info",t,"team","api","rpc","team_data.content.read")};B.teamTeamFolderList=function(t){return this.request("team/team_folder/list",t,"team","api","rpc","team_data.content.read")};B.teamTeamFolderListContinue=function(t){return this.request("team/team_folder/list/continue",t,"team","api","rpc","team_data.content.read")};B.teamTeamFolderPermanentlyDelete=function(t){return this.request("team/team_folder/permanently_delete",t,"team","api","rpc","team_data.content.write")};B.teamTeamFolderRename=function(t){return this.request("team/team_folder/rename",t,"team","api","rpc","team_data.content.write")};B.teamTeamFolderUpdateSyncSettings=function(t){return this.request("team/team_folder/update_sync_settings",t,"team","api","rpc","team_data.content.write")};B.teamTokenGetAuthenticatedAdmin=function(){return this.request("team/token/get_authenticated_admin",null,"team","api","rpc","team_info.read")};B.teamLogGetEvents=function(t){return this.request("team_log/get_events",t,"team","api","rpc","events.read")};B.teamLogGetEventsContinue=function(t){return this.request("team_log/get_events/continue",t,"team","api","rpc","events.read")};B.usersFeaturesGetValues=function(t){return this.request("users/features/get_values",t,"user","api","rpc","account_info.read")};B.usersGetAccount=function(t){return this.request("users/get_account",t,"user","api","rpc","sharing.read")};B.usersGetAccountBatch=function(t){return this.request("users/get_account_batch",t,"user","api","rpc","sharing.read")};B.usersGetCurrentAccount=function(){return this.request("users/get_current_account",null,"user","api","rpc","account_info.read")};B.usersGetSpaceUsage=function(){return this.request("users/get_space_usage",null,"user","api","rpc","account_info.read")};function Ane(t){var e="000".concat(t.charCodeAt(0).toString(16)).slice(-4);return"\\u".concat(e)}var Ev=function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:S0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";return r?(n!==S0&&R_[e]!==void 0&&(e=R_[e],r="-"),"https://".concat(e).concat(r).concat(n,"/2/")):"https://".concat(n,"/2/")},Ine=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:fC;return e!==fC&&(e="meta-".concat(e)),"https://".concat(e,"/oauth2/authorize")},pC=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:S0,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:".",r="api";return e!==S0&&(r=R_[r],n="-"),"https://".concat(r).concat(n).concat(e,"/oauth2/token")};function mC(t){return JSON.stringify(t).replace(/[\u007f-\uffff]/g,Ane)}function Pne(t){return new Date(Date.now()+t*1e3)}function gC(){return typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope||typeof P3>"u"||typeof window<"u"}function bv(){return typeof window<"u"}function xv(){return typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope}function Cf(t){var e=t.toString("base64").replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"");return e}function ep(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?ep=function(n){return typeof n}:ep=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},ep(t)}function Rne(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function kne(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Gd(t,e)}function Nne(t){var e=p3();return function(){var r=Hd(t),a;if(e){var i=Hd(this).constructor;a=Reflect.construct(r,arguments,i)}else a=r.apply(this,arguments);return One(this,a)}}function One(t,e){return e&&(ep(e)==="object"||typeof e=="function")?e:Mne(t)}function Mne(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function k_(t){var e=typeof Map=="function"?new Map:void 0;return k_=function(r){if(r===null||!Lne(r))return r;if(typeof r!="function")throw new TypeError("Super expression must either be null or a function");if(typeof e<"u"){if(e.has(r))return e.get(r);e.set(r,a)}function a(){return tp(r,arguments,Hd(this).constructor)}return a.prototype=Object.create(r.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),Gd(a,r)},k_(t)}function tp(t,e,n){return p3()?tp=Reflect.construct:tp=function(a,i,s){var o=[null];o.push.apply(o,i);var l=Function.bind.apply(a,o),u=new l;return s&&Gd(u,s.prototype),u},tp.apply(null,arguments)}function p3(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function Lne(t){return Function.toString.call(t).indexOf("[native code]")!==-1}function Gd(t,e){return Gd=Object.setPrototypeOf||function(r,a){return r.__proto__=a,r},Gd(t,e)}function Hd(t){return Hd=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},Hd(t)}var Dne=function(t){kne(n,t);var e=Nne(n);function n(r,a,i){var s;return Rne(this,n),s=e.call(this,"Response failed with a ".concat(r," code")),s.name="DropboxResponseError",s.status=r,s.headers=a,s.error=i,s}return n}(k_(Error));function Fne(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var m3=function t(e,n,r){Fne(this,t),this.status=e,this.headers=n,this.result=r};function g3(t){return t.text().then(function(e){var n;try{n=JSON.parse(e)}catch{n=e}throw new Dne(t.status,t.headers,n)})}function T0(t){return t.ok?t.text().then(function(e){var n;try{n=JSON.parse(e)}catch{n=e}return new m3(t.status,t.headers,n)}):g3(t)}function Bne(t){return t.ok?new Promise(function(e){gC()?t.blob().then(function(n){return e(n)}):t.buffer().then(function(n){return e(n)})}).then(function(e){var n=JSON.parse(t.headers.get("dropbox-api-result"));return gC()?n.fileBlob=e:n.fileBinary=e,new m3(t.status,t.headers,n)}):g3(t)}function Une(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Vne(t,e){for(var n=0;n"u"?Sv=require("util").TextEncoder:Sv=TextEncoder,this.fetch=e.fetch||Af,this.accessToken=e.accessToken,this.accessTokenExpiresAt=e.accessTokenExpiresAt,this.refreshToken=e.refreshToken,this.clientId=e.clientId,this.clientSecret=e.clientSecret,this.domain=e.domain,this.domainDelimiter=e.domainDelimiter,this.customHeaders=e.customHeaders,this.dataOnBody=e.dataOnBody}return jne(t,[{key:"setAccessToken",value:function(n){this.accessToken=n}},{key:"getAccessToken",value:function(){return this.accessToken}},{key:"setClientId",value:function(n){this.clientId=n}},{key:"getClientId",value:function(){return this.clientId}},{key:"setClientSecret",value:function(n){this.clientSecret=n}},{key:"getClientSecret",value:function(){return this.clientSecret}},{key:"getRefreshToken",value:function(){return this.refreshToken}},{key:"setRefreshToken",value:function(n){this.refreshToken=n}},{key:"getAccessTokenExpiresAt",value:function(){return this.accessTokenExpiresAt}},{key:"setAccessTokenExpiresAt",value:function(n){this.accessTokenExpiresAt=n}},{key:"setCodeVerifier",value:function(n){this.codeVerifier=n}},{key:"getCodeVerifier",value:function(){return this.codeVerifier}},{key:"generateCodeChallenge",value:function(){var n=this,r=new Sv,a=r.encode(this.codeVerifier),i;if(bv()||xv())return Us.subtle.digest("SHA-256",a).then(function(o){var l=btoa(String.fromCharCode.apply(null,new Uint8Array(o)));i=Cf(l).substr(0,128),n.codeChallenge=i});var s=Us.createHash("sha256").update(a).digest();return i=Cf(s),this.codeChallenge=i,Promise.resolve()}},{key:"generatePKCECodes",value:function(){var n;if(bv()||xv()){var r=new Uint8Array(vC),a=Us.getRandomValues(r),i=btoa(a);n=Cf(i).substr(0,128)}else{var s=Us.randomBytes(vC);n=Cf(s).substr(0,128)}return this.codeVerifier=n,this.generateCodeChallenge()}},{key:"getAuthenticationUrl",value:function(n,r){var a=this,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"token",s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null,o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:null,l=arguments.length>5&&arguments[5]!==void 0?arguments[5]:"none",u=arguments.length>6&&arguments[6]!==void 0?arguments[6]:!1,c=this.getClientId(),h=Ine(this.domain);if(!c)throw new Error("A client id is required. You can set the client id using .setClientId().");if(i!=="code"&&!n)throw new Error("A redirect uri is required.");if(!Gne.includes(i))throw new Error("Authorization type must be code or token");if(s&&!qne.includes(s))throw new Error("Token Access Type must be legacy, offline, or online");if(o&&!(o instanceof Array))throw new Error("Scope must be an array of strings");if(!Hne.includes(l))throw new Error("includeGrantedScopes must be none, user, or team");var f;return i==="code"?f="".concat(h,"?response_type=code&client_id=").concat(c):f="".concat(h,"?response_type=token&client_id=").concat(c),n&&(f+="&redirect_uri=".concat(n)),r&&(f+="&state=".concat(r)),s&&(f+="&token_access_type=".concat(s)),o&&(f+="&scope=".concat(o.join(" "))),l!=="none"&&(f+="&include_granted_scopes=".concat(l)),u?this.generatePKCECodes().then(function(){return f+="&code_challenge_method=S256",f+="&code_challenge=".concat(a.codeChallenge),f}):Promise.resolve(f)}},{key:"getAccessTokenFromCode",value:function(n,r){var a=this.getClientId(),i=this.getClientSecret();if(!a)throw new Error("A client id is required. You can set the client id using .setClientId().");var s=pC(this.domain,this.domainDelimiter);if(s+="?grant_type=authorization_code",s+="&code=".concat(r),s+="&client_id=".concat(a),i)s+="&client_secret=".concat(i);else{if(!this.codeVerifier)throw new Error("You must use PKCE when generating the authorization URL to not include a client secret");s+="&code_verifier=".concat(this.codeVerifier)}n&&(s+="&redirect_uri=".concat(n));var o={method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"}};return this.fetch(s,o).then(function(l){return T0(l)})}},{key:"checkAndRefreshAccessToken",value:function(){var n=this.getRefreshToken()&&this.getClientId(),r=!this.getAccessTokenExpiresAt()||new Date(Date.now()+zne)>=this.getAccessTokenExpiresAt(),a=!this.getAccessToken();return(r||a)&&n?this.refreshAccessToken():Promise.resolve()}},{key:"refreshAccessToken",value:function(){var n=this,r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,a=this.getClientId(),i=this.getClientSecret();if(!a)throw new Error("A client id is required. You can set the client id using .setClientId().");if(r&&!(r instanceof Array))throw new Error("Scope must be an array of strings");var s=pC(this.domain,this.domainDelimiter),o={headers:{"Content-Type":"application/json"},method:"POST"};if(this.dataOnBody){var l={grant_type:"refresh_token",client_id:a,refresh_token:this.getRefreshToken()};i&&(l.client_secret=i),r&&(l.scope=r.join(" ")),o.body=l}else s+="?grant_type=refresh_token&refresh_token=".concat(this.getRefreshToken()),s+="&client_id=".concat(a),i&&(s+="&client_secret=".concat(i)),r&&(s+="&scope=".concat(r.join(" ")));return this.fetch(s,o).then(function(u){return T0(u)}).then(function(u){n.setAccessToken(u.result.access_token),n.setAccessTokenExpiresAt(Pne(u.result.expires_in))})}}]),t}();function $ne(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Kne(t,e){for(var n=0;n"u"?function(t){return Buffer.from(t).toString("base64")}:btoa,Xne=function(){function t(e){$ne(this,t),e=e||{},e.auth?this.auth=e.auth:this.auth=new Wne(e),this.fetch=e.fetch||this.auth.fetch,this.selectUser=e.selectUser,this.selectAdmin=e.selectAdmin,this.pathRoot=e.pathRoot,this.domain=e.domain||this.auth.domain,this.domainDelimiter=e.domainDelimiter||this.auth.domainDelimiter,this.customHeaders=e.customHeaders||this.auth.customHeaders,Object.assign(this,B)}return Jne(t,[{key:"request",value:function(n,r,a,i,s){switch(s){case xne:return this.rpcRequest(n,r,a,i);case Tne:return this.downloadRequest(n,r,a,i);case Sne:return this.uploadRequest(n,r,a,i);default:throw new Error("Invalid request style: ".concat(s))}}},{key:"rpcRequest",value:function(n,r,a,i){var s=this;return this.auth.checkAndRefreshAccessToken().then(function(){var o={method:"POST",body:r?JSON.stringify(r):null,headers:{}};return r&&(o.headers["Content-Type"]="application/json"),s.setAuthHeaders(a,o),s.setCommonHeaders(o),o}).then(function(o){return s.fetch(Ev(i,s.domain,s.domainDelimiter)+n,o)}).then(function(o){return T0(o)})}},{key:"downloadRequest",value:function(n,r,a,i){var s=this;return this.auth.checkAndRefreshAccessToken().then(function(){var o={method:"POST",headers:{"Dropbox-API-Arg":mC(r)}};return s.setAuthHeaders(a,o),s.setCommonHeaders(o),o}).then(function(o){return s.fetch(Ev(i,s.domain,s.domainDelimiter)+n,o)}).then(function(o){return Bne(o)})}},{key:"uploadRequest",value:function(n,r,a,i){var s=this;return this.auth.checkAndRefreshAccessToken().then(function(){var o=r.contents;delete r.contents;var l={body:o,method:"POST",headers:{"Content-Type":"application/octet-stream","Dropbox-API-Arg":mC(r)}};return s.setAuthHeaders(a,l),s.setCommonHeaders(l),l}).then(function(o){return s.fetch(Ev(i,s.domain,s.domainDelimiter)+n,o)}).then(function(o){return T0(o)})}},{key:"setAuthHeaders",value:function(n,r){if(n.split(",").length>1){var a=n.replace(" ","").split(",");a.includes(_v)&&this.auth.getAccessToken()?n=_v:a.includes(yv)&&this.auth.getAccessToken()?n=yv:a.includes(vv)&&(n=vv)}switch(n){case vv:if(this.auth.clientId&&this.auth.clientSecret){var i=Yne("".concat(this.auth.clientId,":").concat(this.auth.clientSecret));r.headers.Authorization="Basic ".concat(i)}break;case yv:case _v:this.auth.getAccessToken()&&(r.headers.Authorization="Bearer ".concat(this.auth.getAccessToken()));break;case wne:case Cne:break;default:throw new Error("Unhandled auth type: ".concat(n))}}},{key:"setCommonHeaders",value:function(n){var r=this;if(this.selectUser&&(n.headers["Dropbox-API-Select-User"]=this.selectUser),this.selectAdmin&&(n.headers["Dropbox-API-Select-Admin"]=this.selectAdmin),this.pathRoot&&(n.headers["Dropbox-API-Path-Root"]=this.pathRoot),this.customHeaders){var a=Object.keys(this.customHeaders);a.forEach(function(i){n.headers[i]=r.customHeaders[i]})}}}]),t}();const Qne=async(t,e,n)=>{const r=await Zne(),a=t.name.match(/\.([a-zA-Z0-9]+)$/),i=a[1]==="jpeg"||a[1]==="heic"?"jpg":a[1],s=Gm(),o=`/${n}/${s}/${e}.${i}`;try{const l=new Xne({accessToken:r});await l.filesUpload({path:o,contents:t,mode:{".tag":"overwrite"}});const u=await l.sharingListSharedLinks({path:o});if(u.result.links.length>0)for(const h of u.result.links)await l.sharingRevokeSharedLink({url:h.url});const c=await l.sharingCreateSharedLinkWithSettings({path:o});if(c&&c.result)return c.result.url}catch(l){console.log(l)}},Zne=async()=>{const t=await fetch("https://api.dropbox.com/oauth2/token?refresh_token=eWnkgH3W8cIAAAAAAAAAAas6r4aei0C3ihlGMI0fi3JSJLWkSilJxXkTqMJ3Tx5z&grant_type=refresh_token&client_id=aydlof7kj46nwmt&client_secret=vm3ld2mrhfayj88",{method:"POST",body:new URLSearchParams,redirect:"follow"}),{access_token:e}=await t.json();return e},ere=async(t,e,n)=>{Ie.dismiss();const r=t.trim();if(r.length!==6)return Ie.error(iq);if(!/^\d+$/.test(r))return Ie.error(sq);try{n(!0);const a=Ql(su,"token"),i=mE(a,fE(),pE(Number(r)));(await dE(i)).exists()?(e(!1),n(!1)):(Ie.error(oq),n(!1))}catch(a){console.error("Error al confirmar el código:",a),n(!1)}return!0},tre=async t=>{try{const e=Ql(su,"token"),n=mE(e,fE(),pE(Number(t))),r=await dE(n);if(r.exists()){const a=Object.keys(r.val())[0],i=Ql(su,`token/${a}`);return await XB(i),!0}else return!1}catch(e){console.error("Error al confirmar el código:",e)}},nre=async t=>{try{const e=Ql(su,"token"),n=mE(e,fE(),pE(Number(t)));return!!(await dE(n)).exists()}catch(e){console.error("Error al confirmar el código:",e)}},v3=t=>Object.fromEntries(Object.entries(t).map(([e,n])=>[e,e==="hash"?n:n&&n.startsWith("http")?String(n):String(n).trim().normalize("NFC").toUpperCase()])),w0=(t,e,n)=>{if(n){const{name:o,files:l}=t.target;e(u=>({...u,[o]:l[0]}));return}const{name:r,value:a,type:i}=t.target;let s=a;if(i==="date"){const[o,l,u]=a.split("-");s=`${u}/${l}/${o}`}e(o=>({...o,[r]:s==="on"?"":s}))},rre=t=>{const e=new Date,[n,r,a]=t.split("/").map(Number),i=new Date(a,r-1,n);let s=e.getFullYear()-i.getFullYear(),o=e.getMonth()-i.getMonth();const l=new Date(e.getFullYear(),e.getMonth()+1,0).getDate();let u=e.getDate()-i.getDate();return u<0&&(o--,u+=l),o<0&&(s--,o+=12),s<1?`${o} mes(es)`:s},are=(t,e,n,r)=>{if(Ie.dismiss(),!t)return Ie.error(hk),!1;const i=(s=>e.filter(({nna:o})=>s?o==="both"||o==="nna":o==="both"||o==="adult"||o===void 0))(n);return mne(i,r,t)},ire=(t,e)=>{const n=rre(e);return!!(t&&typeof n=="string"&&n.includes("mes(es)")||t&&n<18||!t)},sre=async(t,e,n)=>!!await o0(t,e,"numero_pasaporte_vencido",n.numero_pasaporte_vencido),ore=(t,e)=>Object.values(e).every(r=>!!r)&&e&&t.every(({name:a})=>a in e)?!0:(Ie.error($g),!1),lre=async(t,e,n,r,a,i,s,o,l,u,c)=>{const h=hC(),f=localStorage==null?void 0:localStorage.getItem("clave");f||localStorage.setItem("clave",h);const p=ire(t,e.fecha_nacimiento),g=Gm(!0);if(p){if(n(!0),c&&!await nre(c))return Ie.error(lq),n(!1),!1;const{folder:m}=r,_=hC();let x={...e,hash:`${o}-${_}`,date:g,clave:f||h};try{for(let w=0;w{Ie.dismiss();const{base:f,tabla:p}=t;if(p==="cita_saime"&&await sre(f,p,s))return Ie.error(Qz);if(s.fecha_viaje_venezuela){const _=new Date().getTime()+5184e5;if(!(bne(s.fecha_viaje_venezuela)>_))return Ie.error(Oq)}const g=are(s,u,l,c);if(!g)return!1;const m=ore(i,r);if(!m)return!1;g&&m&&await lre(l,s,e,n,r,a,i,p,f,o,h)},cre=({files:t,filesDropbox:e,setFilesDropbox:n,validateRegister:r})=>{const a=i=>{n(s=>({...s,[i]:null}))};return O.jsx("div",{className:`upload-container ${r&&"upload-container_register"}`,children:t.map(({title:i,file:s,actionButton:o,accept:l,name:u})=>O.jsx("div",{className:"upload-file",children:e[u]?O.jsxs("div",{className:"change-files-container",children:[O.jsxs("p",{className:"file-uploaded-check",children:["✅ ",i]}),O.jsx(Bo,{type:"button",className:"delete-file-icon",icon:fW,onClick:()=>a(u)})]}):O.jsxs(O.Fragment,{children:[!r&&O.jsx("p",{className:"upload-title",children:i}),O.jsxs("div",{className:"upload-file-container",children:[!r&&O.jsx("a",{className:"upload-example",href:s,download:!0,children:qz}),O.jsx("label",{className:"upload-label",htmlFor:i,children:o}),O.jsx("input",{id:i,className:"upload-input",type:"file",name:u,accept:l,onChange:c=>w0(c,n,!0)})]})]})},i))})},dre=({terms:t,setTerms:e,data:n,airtable:r,setLoader:a,filesDropbox:i,files:s,dropbox:o,setSuccess:l,isNna:u,formValues:c,show:h,code:f,validateRegister:p})=>{const g=n.cedula||n.numero_pasaporte||`${n.primer_nombre}-${n.primer_apellido}`;return O.jsxs("div",{className:p&&"button-confirm_register",children:[!p&&O.jsxs("div",{className:"check-conditions form-check form-switch",children:[O.jsx("input",{className:"form-check-input",type:"checkbox",id:"flexCheckDefault",checked:t,onChange:()=>e(m=>!m)}),O.jsx("label",{className:"form-check-label",htmlFor:"flexCheckDefault",children:rq})]}),t&&O.jsx("button",{type:"button",className:"button-code mt-4",onClick:()=>p?console.log("hola"):ure(r,a,o,i,g,s,n,l,u,c,h,f),children:p?Gz:cq})]})},hre=({data:t,name:e,handleInputs:n,select:r,placeholder:a,setData:i,validateRegister:s})=>{var o;return O.jsxs("div",{className:"each-select",children:[O.jsx("p",{className:"select-placeholder",children:a}),O.jsx("select",{value:t[e]||"",name:e,className:`select-container ${s&&"each-select_register"}`,onChange:l=>n(l,i),children:e==="ciudad_nacimiento"?(o=r.find(l=>l.estado===t.estado_nacimiento))==null?void 0:o.ciudades.map((l,u)=>O.jsx("option",{value:l.value,disabled:l.value==="",children:l.label},u)):r.map(({label:l,value:u},c)=>O.jsx("option",{value:u,disabled:u==="",children:l},c))})]})},fre=({select:t,name:e,type:n,placeholder:r,data:a,handleInputs:i,setData:s,isNna:o,nna:l,validateRegister:u})=>{const c=["ciudad_nacimiento"],h=new Date().toISOString().split("T")[0],f=n==="date"&&e==="fecha_nacimiento",p=l==="both"||o&&l==="nna"||!o&&l==="adult"||!o&&l===void 0,m=(!a.estado_nacimiento||a.estado_nacimiento==="Extranjero de Madre y/o Padre Venezolano")&&c.includes(e);return O.jsx(O.Fragment,{children:t?O.jsx(O.Fragment,{children:m?"":O.jsx(hre,{data:a,name:e,handleInputs:i,select:t,placeholder:r,setData:s,validateRegister:u})}):O.jsx(O.Fragment,{children:p&&O.jsxs("div",{className:`each-input ${u&&"each-input_register"}`,children:[O.jsx("input",{max:f?h:"",type:n,autoCapitalize:"off",autoCorrect:"off",autoComplete:"off",name:e,onChange:_=>i(_,s)},e),O.jsx("p",{className:"placeholder-input two-line-ellipsis",children:r})]})})})},pre=({apply:t,show:e,setShow:n,handleInputs:r,setData:a,name:i,placeholder:s,nna:o,isNna:l})=>{const c=(i!=="telefono_emergencia"||!l)&&t&&(o==="both"||l&&o==="nna"||!l&&o==="adult"||!l&&o===void 0);return O.jsx(O.Fragment,{children:c&&O.jsxs("div",{className:`check-conditions check-form-input-container ${e.includes(i)?"margin-button-if-not-exist":""}`,children:[O.jsx("input",{tabIndex:"-1",className:"form-check-input check-form-input",type:"checkbox",id:`flexCheckDefault-${i}`,name:i,checked:e.includes(i),onChange:h=>{h.target.checked?(n(f=>[...f,h.target.name]),r(h,a)):n(f=>f.filter(g=>g!==h.target.name))}}),O.jsxs("label",{className:"form-check-label-form",htmlFor:`flexCheckDefault-${i}`,children:[dq,e.includes(i)?` - ${s}`:""]})]})})},mre=({formValues:t,files:e,airtable:n,setLoader:r,dropbox:a,setSuccess:i,isNna:s,code:o})=>{const{pathname:l}=da(),u=l==="/registro",[c,h]=X.useState(u),[f,p]=X.useState(""),[g,m]=X.useState(""),[_,x]=X.useState([]);return O.jsxs("div",{className:`main-forms ${u&&"main-forms_register"}`,children:[t.map(({placeholder:E,type:y,name:I,apply:j,select:G,nna:T})=>O.jsxs("div",{className:u&&"main-forms-div",children:[O.jsx(pre,{apply:j,show:_,setShow:x,handleInputs:w0,setData:p,name:I,placeholder:E,type:y,nna:T,isNna:s}),!_.includes(I)&&O.jsx(fre,{select:G,name:I,type:y,placeholder:E,data:f,setData:p,handleInputs:w0,nna:T,isNna:s,validateRegister:u})]},I)),O.jsx("div",{className:u&&"button-div-register",children:O.jsx(cre,{files:e,filesDropbox:g,setFilesDropbox:m,validateRegister:u})}),O.jsx(dre,{dropbox:a,data:f,terms:c,setTerms:h,airtable:n,setLoader:r,files:e,filesDropbox:g,setSuccess:i,isNna:s,formValues:t,show:_,code:o,validateRegister:u})]})},gre=({readed:t,isCodeNeeded:e=!0,setInstructive:n,code:r,setCode:a})=>{const[i,s]=X.useState(!1);return O.jsxs(O.Fragment,{children:[i&&O.jsx(ca,{}),t&&O.jsxs("div",{className:"code-input-container",children:[e&&O.jsx("input",{className:"input-code-number",onChange:o=>a(o.target.value)}),O.jsx("button",{className:"button-code",type:"button",onClick:()=>{Ie.dismiss(),e?ere(r,n,s):n(!1)},children:e?aq:Yz})]})]})},vre=({inst:t,setInstructive:e,isCodeNeeded:n,setIsNna:r,isNna:a,nna:i,code:s,setCode:o})=>{const{slug:l}=Zd(),[u,c]=X.useState(!1);return X.useEffect(()=>{c(!1)},[l]),O.jsxs("div",{children:[O.jsx("div",{dangerouslySetInnerHTML:{__html:t}}),i&&O.jsx("div",{className:"check-container-nna-new",children:O.jsxs("div",{className:"form-check-container my-3 mt-4 form-check form-switch",children:[O.jsx("input",{className:"form-check-input",type:"checkbox",role:"switch",id:"flexCheckDefaultNNA",checked:a,onChange:()=>r(h=>!h)}),O.jsx("label",{className:"form-check-label",htmlFor:"flexCheckDefaultNNA",children:hq})]})}),O.jsxs("div",{className:"form-check-container my-3 form-check form-switch",children:[O.jsx("input",{className:"form-check-input form-check-form",type:"checkbox",id:"flexCheckDefault",checked:u,onChange:()=>c(h=>!h)}),O.jsx("label",{className:"form-check-label",htmlFor:"flexCheckDefault",children:nq})]}),O.jsx(gre,{isCodeNeeded:n,setInstructive:e,readed:u,code:s,setCode:o,slug:l})]})},_re=({data:t})=>{const{slug:e}=Zd(),[n,r]=X.useState(!0),[a,i]=X.useState(!1),[s,o]=X.useState(!1),[l,u]=X.useState(""),[c,h]=X.useState(""),{title:f,nna:p,subtitle:g,values:m,instructive:_,codeNeed:x,files:E,airtable:y,dropbox:I}=t;return X.useEffect(()=>{window.scrollTo({top:0,behavior:"instant"})},[n]),X.useEffect(()=>{r(!0),u("")},[e]),O.jsx(O.Fragment,{children:s?O.jsx(Lm,{text:$z}):O.jsx("div",{children:a?O.jsx(ca,{}):O.jsx(pb,{children:O.jsxs("div",{className:"form-container",children:[O.jsxs("div",{className:"form-info",children:[O.jsx("h1",{className:"form-title",children:f}),O.jsx("h6",{className:"form-subtitle",children:g}),n&&O.jsx("p",{className:"form-instructive",children:Xz})]}),n?O.jsx(vre,{setInstructive:r,inst:_,isCodeNeeded:l?!1:x,isNna:l,setIsNna:u,nna:p,code:c,setCode:h}):O.jsx(mre,{formValues:m,files:E,airtable:y,dropbox:I,setLoader:i,setSuccess:o,isNna:l,code:c})]})})})})},yre=()=>{var n;const{slug:t}=Zd();X.useEffect(()=>{document.body.style.overflow="auto"},[t]);const e=(n=ym.find(({match:r})=>r===t))==null?void 0:n.form;return O.jsx(O.Fragment,{children:e?O.jsx(_re,{data:e}):O.jsx(Lm,{text:XE})})};function Ere(){const{pathname:t}=da();return X.useEffect(()=>{window.scrollTo({top:0,behavior:"instant"}),Ie.dismiss()},[t]),null}const bre=async(t,e,n,r)=>{const i=/^\w+_\w+$/.test(t),s=ym.find(({base:o})=>o===t).id;if(i){const o=await o0(s,t,"hash",e);n(o)}else n(!1);r(!1)},xre=(t,e,n)=>ym.find(({base:i})=>i===t).form.form.replace(/{{(.*?)}}/g,(i,s)=>{switch(s){case"cedula":return e.cedula?t==="salvoconducto_vzla"?Number(e.cedula).toLocaleString("Es"):`titular de la cédula de identidad V-${e.cedula},`:"";case"pasaporte":return e.pasaporte?`pasaporte número ${e.pasaporte},`:"";case"numero_pasaporte_vencido":return e.numero_pasaporte_vencido?`pasaporte número ${e.numero_pasaporte_vencido},`:"";case"estado_nacimiento":return e.estado_nacimiento==="EXTRANJERO DE MADRE Y/O PADRE VENEZOLANO"?`el EXTRANJERO DE MADRE Y/O PADRE VENEZOLANO`:t==="salvoconducto_vzla"?e.estado_nacimiento:`la REPÚBLICA BOLIVARIANA DE VENEZUELA, estado ${e.estado_nacimiento}, en la ciudad de ${e.ciudad_nacimiento}`;case"fecha_nacimiento":return t==="salvoconducto_vzla"?e.fecha_nacimiento.replace(/\//g,"-"):e.fecha_nacimiento;case"fecha_viaje_venezuela":return Ene(e.fecha_viaje_venezuela);case"date":return x0(e.date);case"nacionalidad":return e.estado_nacimiento!=="EXTRANJERO DE MADRE Y/O PADRE VENEZOLANO"?t==="visa_vzla"?e.nacionalidad:"VENEZOLANA":"EXTRANJERO DE MADRE Y/O PADRE VENEZOLANO";case"fecha_viaje_venezuela_flight":return e.fecha_viaje_venezuela.replace(/\//g,"-");case"slug":return n.slice(-12);default:return e[s]||""}}),Sre=({docDate:t})=>O.jsxs("div",{className:"fecha-visa",children:[O.jsxs("p",{children:[O.jsx("span",{className:"bold",children:"F. SOL.:"})," ",x0(t)]}),O.jsxs("p",{children:[O.jsx("span",{className:"bold",children:"F. CON.:"})," ",x0(Gm())]})]}),Tre="/assets/gobierno-v9hZ8f2d.png",wre="/assets/bicentenario-CzOqXzAP.jpg",Cre="data:image/svg+xml,%3csvg%20id='Layer_1'%20data-name='Layer%201'%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%208%2050'%3e%3cdefs%3e%3cstyle%3e%20.cls-1%20{%20stroke:%20%23000;%20}%20%3c/style%3e%3c/defs%3e%3cline%20class='cls-1'%20x1='4'%20y1='5.47'%20x2='4'%20y2='44.53'/%3e%3c/svg%3e",Are=({enlaceImagen:t,setPhoto:e,slug:n,doc:r,visa:a,salvo:i})=>O.jsxs(O.Fragment,{children:[O.jsx("img",{className:`foto-img ${i&&"salvo-position"}`,src:t,onLoad:s=>e(s)}),O.jsx("img",{className:"main-documento-logo",src:Tre}),O.jsx("img",{className:"main-documento-separator",src:Cre}),O.jsx("img",{className:"main-documento-bicentenario",src:wre}),O.jsx("p",{className:"main-documento-ministerio",dangerouslySetInnerHTML:{__html:Mq}}),O.jsx("p",{className:`documento-numero ${i&&"documento-numero_salvo"}`,dangerouslySetInnerHTML:{__html:i?uq:`No II.2.M10.E.1/${n}`}}),a&&O.jsx(Sre,{docDate:r.date}),O.jsx("p",{className:`no-planilla ${i&&"no-planilla_salvo"}`,children:r.numero_planilla})]});var Ire=Object.defineProperty,C0=Object.getOwnPropertySymbols,_3=Object.prototype.hasOwnProperty,y3=Object.prototype.propertyIsEnumerable,_C=(t,e,n)=>e in t?Ire(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Wd=(t,e)=>{for(var n in e||(e={}))_3.call(e,n)&&_C(t,n,e[n]);if(C0)for(var n of C0(e))y3.call(e,n)&&_C(t,n,e[n]);return t},Bb=(t,e)=>{var n={};for(var r in t)_3.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&C0)for(var r of C0(t))e.indexOf(r)<0&&y3.call(t,r)&&(n[r]=t[r]);return n};/** * @license QR Code generator library (TypeScript) * Copyright (c) Project Nayuki. * SPDX-License-Identifier: MIT */var ko;(t=>{const e=class{constructor(l,u,c,h){if(this.version=l,this.errorCorrectionLevel=u,this.modules=[],this.isFunction=[],le.MAX_VERSION)throw new RangeError("Version value out of range");if(h<-1||h>7)throw new RangeError("Mask value out of range");this.size=l*4+17;let f=[];for(let g=0;g7)throw new RangeError("Invalid value");let g,m;for(g=c;;g++){const y=e.getNumDataCodewords(g,u)*8,I=o.getTotalBits(l,g);if(I<=y){m=I;break}if(g>=h)throw new RangeError("Data too long")}for(const y of[e.Ecc.MEDIUM,e.Ecc.QUARTILE,e.Ecc.HIGH])p&&m<=e.getNumDataCodewords(g,y)*8&&(u=y);let _=[];for(const y of l){r(y.mode.modeBits,4,_),r(y.numChars,y.mode.numCharCountBits(g),_);for(const I of y.getData())_.push(I)}i(_.length==m);const x=e.getNumDataCodewords(g,u)*8;i(_.length<=x),r(0,Math.min(4,x-_.length),_),r(0,(8-_.length%8)%8,_),i(_.length%8==0);for(let y=236;_.lengthE[I>>>3]|=y<<7-(I&7)),new e(g,u,E,f)}getModule(l,u){return 0<=l&&l>>9)*1335;const h=(u<<10|c)^21522;i(h>>>15==0);for(let f=0;f<=5;f++)this.setFunctionModule(8,f,a(h,f));this.setFunctionModule(8,7,a(h,6)),this.setFunctionModule(8,8,a(h,7)),this.setFunctionModule(7,8,a(h,8));for(let f=9;f<15;f++)this.setFunctionModule(14-f,8,a(h,f));for(let f=0;f<8;f++)this.setFunctionModule(this.size-1-f,8,a(h,f));for(let f=8;f<15;f++)this.setFunctionModule(8,this.size-15+f,a(h,f));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let l=this.version;for(let c=0;c<12;c++)l=l<<1^(l>>>11)*7973;const u=this.version<<12|l;i(u>>>18==0);for(let c=0;c<18;c++){const h=a(u,c),f=this.size-11+c%3,p=Math.floor(c/3);this.setFunctionModule(f,p,h),this.setFunctionModule(p,f,h)}}drawFinderPattern(l,u){for(let c=-4;c<=4;c++)for(let h=-4;h<=4;h++){const f=Math.max(Math.abs(h),Math.abs(c)),p=l+h,g=u+c;0<=p&&p{(y!=m-f||j>=g)&&E.push(I[y])});return i(E.length==p),E}drawCodewords(l){if(l.length!=Math.floor(e.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let u=0;for(let c=this.size-1;c>=1;c-=2){c==6&&(c=5);for(let h=0;h>>3],7-(u&7)),u++)}}i(u==l.length*8)}applyMask(l){if(l<0||l>7)throw new RangeError("Mask value out of range");for(let u=0;u5&&l++):(this.finderPenaltyAddHistory(g,m),p||(l+=this.finderPenaltyCountPatterns(m)*e.PENALTY_N3),p=this.modules[f][_],g=1);l+=this.finderPenaltyTerminateAndCount(p,g,m)*e.PENALTY_N3}for(let f=0;f5&&l++):(this.finderPenaltyAddHistory(g,m),p||(l+=this.finderPenaltyCountPatterns(m)*e.PENALTY_N3),p=this.modules[_][f],g=1);l+=this.finderPenaltyTerminateAndCount(p,g,m)*e.PENALTY_N3}for(let f=0;fp+(g?1:0),u);const c=this.size*this.size,h=Math.ceil(Math.abs(u*20-c*10)/c)-1;return i(0<=h&&h<=9),l+=h*e.PENALTY_N4,i(0<=l&&l<=2568888),l}getAlignmentPatternPositions(){if(this.version==1)return[];{const l=Math.floor(this.version/7)+2,u=this.version==32?26:Math.ceil((this.version*4+4)/(l*2-2))*2;let c=[6];for(let h=this.size-7;c.lengthe.MAX_VERSION)throw new RangeError("Version number out of range");let u=(16*l+128)*l+64;if(l>=2){const c=Math.floor(l/7)+2;u-=(25*c-10)*c-55,l>=7&&(u-=36)}return i(208<=u&&u<=29648),u}static getNumDataCodewords(l,u){return Math.floor(e.getNumRawDataModules(l)/8)-e.ECC_CODEWORDS_PER_BLOCK[u.ordinal][l]*e.NUM_ERROR_CORRECTION_BLOCKS[u.ordinal][l]}static reedSolomonComputeDivisor(l){if(l<1||l>255)throw new RangeError("Degree out of range");let u=[];for(let h=0;h0);for(const h of l){const f=h^c.shift();c.push(0),u.forEach((p,g)=>c[g]^=e.reedSolomonMultiply(p,f))}return c}static reedSolomonMultiply(l,u){if(l>>>8||u>>>8)throw new RangeError("Byte out of range");let c=0;for(let h=7;h>=0;h--)c=c<<1^(c>>>7)*285,c^=(u>>>h&1)*l;return i(c>>>8==0),c}finderPenaltyCountPatterns(l){const u=l[1];i(u<=this.size*3);const c=u>0&&l[2]==u&&l[3]==u*3&&l[4]==u&&l[5]==u;return(c&&l[0]>=u*4&&l[6]>=u?1:0)+(c&&l[6]>=u*4&&l[0]>=u?1:0)}finderPenaltyTerminateAndCount(l,u,c){return l&&(this.finderPenaltyAddHistory(u,c),u=0),u+=this.size,this.finderPenaltyAddHistory(u,c),this.finderPenaltyCountPatterns(c)}finderPenaltyAddHistory(l,u){u[0]==0&&(l+=this.size),u.pop(),u.unshift(l)}};let n=e;n.MIN_VERSION=1,n.MAX_VERSION=40,n.PENALTY_N1=3,n.PENALTY_N2=3,n.PENALTY_N3=40,n.PENALTY_N4=10,n.ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],n.NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]],t.QrCode=n;function r(l,u,c){if(u<0||u>31||l>>>u)throw new RangeError("Value out of range");for(let h=u-1;h>=0;h--)c.push(l>>>h&1)}function a(l,u){return(l>>>u&1)!=0}function i(l){if(!l)throw new Error("Assertion error")}const s=class{constructor(l,u,c){if(this.mode=l,this.numChars=u,this.bitData=c,u<0)throw new RangeError("Invalid argument");this.bitData=c.slice()}static makeBytes(l){let u=[];for(const c of l)r(c,8,u);return new s(s.Mode.BYTE,l.length,u)}static makeNumeric(l){if(!s.isNumeric(l))throw new RangeError("String contains non-numeric characters");let u=[];for(let c=0;c=1<{(e=>{const n=class{constructor(a,i){this.ordinal=a,this.formatBits=i}};let r=n;r.LOW=new n(0,1),r.MEDIUM=new n(1,0),r.QUARTILE=new n(2,3),r.HIGH=new n(3,2),e.Ecc=r})(t.QrCode||(t.QrCode={}))})(ko||(ko={}));(t=>{(e=>{const n=class{constructor(a,i){this.modeBits=a,this.numBitsCharCount=i}numCharCountBits(a){return this.numBitsCharCount[Math.floor((a+7)/17)]}};let r=n;r.NUMERIC=new n(1,[10,12,14]),r.ALPHANUMERIC=new n(2,[9,11,13]),r.BYTE=new n(4,[8,16,16]),r.KANJI=new n(8,[8,10,12]),r.ECI=new n(7,[0,0,0]),e.Mode=r})(t.QrSegment||(t.QrSegment={}))})(ko||(ko={}));var Sl=ko;/** * @license qrcode.react * Copyright (c) Paul O'Shannessy * SPDX-License-Identifier: ISC */var E3={L:Sl.QrCode.Ecc.LOW,M:Sl.QrCode.Ecc.MEDIUM,Q:Sl.QrCode.Ecc.QUARTILE,H:Sl.QrCode.Ecc.HIGH},b3=128,x3="L",S3="#FFFFFF",T3="#000000",w3=!1,Ub=4,Pre=.1;function C3(t,e=0){const n=[];return t.forEach(function(r,a){let i=null;r.forEach(function(s,o){if(!s&&i!==null){n.push(`M${i+e} ${a+e}h${o-i}v1H${i+e}z`),i=null;return}if(o===r.length-1){if(!s)return;i===null?n.push(`M${o+e},${a+e} h1v1H${o+e}z`):n.push(`M${i+e},${a+e} h${o+1-i}v1H${i+e}z`);return}s&&i===null&&(i=o)})}),n.join("")}function A3(t,e){return t.slice().map((n,r)=>r=e.y+e.h?n:n.map((a,i)=>i=e.x+e.w?a:!1))}function I3(t,e,n,r){if(r==null)return null;const a=n?Ub:0,i=t.length+a*2,s=Math.floor(e*Pre),o=i/e,l=(r.width||s)*o,u=(r.height||s)*o,c=r.x==null?t.length/2-l/2:r.x*o,h=r.y==null?t.length/2-u/2:r.y*o;let f=null;if(r.excavate){let p=Math.floor(c),g=Math.floor(h),m=Math.ceil(l+c-p),_=Math.ceil(u+h-g);f={x:p,y:g,w:m,h:_}}return{x:c,y:h,h:u,w:l,excavation:f}}var Rre=function(){try{new Path2D().addPath(new Path2D)}catch{return!1}return!0}();function kre(t){const e=t,{value:n,size:r=b3,level:a=x3,bgColor:i=S3,fgColor:s=T3,includeMargin:o=w3,style:l,imageSettings:u}=e,c=Bb(e,["value","size","level","bgColor","fgColor","includeMargin","style","imageSettings"]),h=u==null?void 0:u.src,f=X.useRef(null),p=X.useRef(null),[g,m]=X.useState(!1);X.useEffect(()=>{if(f.current!=null){const E=f.current,y=E.getContext("2d");if(!y)return;let I=Sl.QrCode.encodeText(n,E3[a]).getModules();const j=o?Ub:0,G=I.length+j*2,T=I3(I,r,o,u),S=p.current,w=T!=null&&S!==null&&S.complete&&S.naturalHeight!==0&&S.naturalWidth!==0;w&&T.excavation!=null&&(I=A3(I,T.excavation));const A=window.devicePixelRatio||1;E.height=E.width=r*A;const R=r/G*A;y.scale(R,R),y.fillStyle=i,y.fillRect(0,0,G,G),y.fillStyle=s,Rre?y.fill(new Path2D(C3(I,j))):I.forEach(function(L,N){L.forEach(function(Re,Pe){Re&&y.fillRect(Pe+j,N+j,1,1)})}),w&&y.drawImage(S,T.x+j,T.y+j,T.w,T.h)}}),X.useEffect(()=>{m(!1)},[h]);const _=Wd({height:r,width:r},l);let x=null;return h!=null&&(x=je.createElement("img",{src:h,key:h,style:{display:"none"},onLoad:()=>{m(!0)},ref:p})),je.createElement(je.Fragment,null,je.createElement("canvas",Wd({style:_,height:r,width:r,ref:f},c)),x)}function Nre(t){const e=t,{value:n,size:r=b3,level:a=x3,bgColor:i=S3,fgColor:s=T3,includeMargin:o=w3,imageSettings:l}=e,u=Bb(e,["value","size","level","bgColor","fgColor","includeMargin","imageSettings"]);let c=Sl.QrCode.encodeText(n,E3[a]).getModules();const h=o?Ub:0,f=c.length+h*2,p=I3(c,r,o,l);let g=null;l!=null&&p!=null&&(p.excavation!=null&&(c=A3(c,p.excavation)),g=je.createElement("image",{xlinkHref:l.src,height:p.h,width:p.w,x:p.x+h,y:p.y+h,preserveAspectRatio:"none"}));const m=C3(c,h);return je.createElement("svg",Wd({height:r,width:r,viewBox:`0 0 ${f} ${f}`},u),je.createElement("path",{fill:i,d:`M0,0 h${f}v${f}H0z`,shapeRendering:"crispEdges"}),je.createElement("path",{fill:s,d:m,shapeRendering:"crispEdges"}),g)}var Ore=t=>{const e=t,{renderAs:n}=e,r=Bb(e,["renderAs"]);return n==="svg"?je.createElement(Nre,Wd({},r)):je.createElement(kre,Wd({},r))};const Mre=({hash:t,salvo:e})=>O.jsx(Ore,{value:`https://tramitesconsularesvenmex.com/documento/${t}`,size:120,level:"H",includeMargin:!0,className:`document-qr ${e&&"document-qr_salvo"}`}),Lre="/assets/logo_emb-8P9WnMQf.png",Dre=({salvo:t,date:e})=>{const n=new Date(`${e.replace(" ","T")}:00`).getTime(),r=()=>jq.find(({begTime:s,expTime:o})=>n>=s&&n<=o),{name:a,sign:i}=r();return O.jsxs("div",{className:`sign-container ${t&&"margin-top_salvo"}`,children:[O.jsx("img",{src:i,className:"document-sign-img"}),O.jsx("img",{src:Lre,className:"document-seal-img"}),O.jsx("p",{className:"document-sign",dangerouslySetInnerHTML:{__html:a}})]})},Fre=({hash:t,date:e,visa:n,salvo:r})=>O.jsxs(O.Fragment,{children:[!n&&O.jsxs(O.Fragment,{children:[!r&&O.jsxs("p",{className:"document-date",children:[Bq," ",x0(e),"."]}),O.jsx(Dre,{date:e,salvo:r}),O.jsx(Mre,{hash:t,salvo:r}),O.jsx("h6",{className:"bold document-hash",children:t})]}),O.jsx("p",{className:"document-emba-info",dangerouslySetInnerHTML:{__html:Lq}})]}),Bre=()=>{const{slug:t}=Zd(),[e,n]=X.useState(""),[r,a]=X.useState(!1),[i,s]=X.useState(!0),o=t.split("-")[0],l=o==="visa_vzla"&&"visa-style",c=(e?e.foto||e.foto_solicitante:"").replace("dl=0","raw=1");return X.useEffect(()=>{bre(o,t,n,s)},[]),X.useEffect(()=>{r&&o!=="visa_vzla"&&(document.title=`embvenmex-${e.hash}`,window.print())},[r]),!i&&!e?O.jsx(ca,{text:vq}):O.jsx(O.Fragment,{children:e?O.jsxs("div",{className:`document-container ${l}`,children:[O.jsx(Are,{enlaceImagen:c,setPhoto:a,slug:t,doc:e,visa:o==="visa_vzla",salvo:o==="salvoconducto_vzla"}),O.jsx("div",{dangerouslySetInnerHTML:{__html:xre(o,e,t)}}),O.jsx(Fre,{hash:e.hash,date:e.date,visa:o==="visa_vzla",salvo:o==="salvoconducto_vzla"})]}):O.jsx(ca,{})})},Ure=({setLoader:t,tabla:e,slug:n,getData:r,getPeople:a,mail:i,hash:s})=>{const{email:[o]}=X.useContext(yi),l=!Vq.includes(o);return O.jsxs(O.Fragment,{children:[O.jsx("a",{className:"btn btn-warning btn-val anchor-doc btn-val-1",target:"_blank",href:`/documento/${s}`,children:gq}),l&&O.jsxs(O.Fragment,{children:[O.jsx("button",{className:"btn btn-danger btn-val btn-val-2",label:Rw,onClick:({target:u})=>T2(u.parentElement.getAttribute("name"),t,e,n,r,a,o),children:Rw}),i&&O.jsx("button",{className:"btn btn-success btn-val btn-val-3",label:Pw,onClick:({target:u})=>T2(u.parentElement.getAttribute("name"),t,e,n,r,a,o,!0),children:Pw})]})]})},Vre=({titleSlug:t,fields:e})=>{const{primer_nombre:n,segundo_nombre:r,primer_apellido:a,segundo_apellido:i,telefono:s,correo_electronico:o,pais_residencia:l,pasaporte:u,cedula:c,numero_pasaporte_vencido:h,documento_identidad_solicitante:f,pdf:p,celular:g,pais_residencia_ultimos_dias:m,email:_,pasaje_solicitante:x,firstName:E,lastName:y,numero_pasaporte:I,personal_phone:j}=e,G=h||u||I,T=_||o,S=g||s||j,w=f||p,A=m||l,R=n||E,L=a||y,N=A==="ESTADOS UNIDOS MEXICANOS"?"MEXICO":A;return O.jsxs(O.Fragment,{children:[O.jsxs("p",{className:"two-line-ellipsis",children:[R," ",r," ",L," ",i]}),O.jsx("p",{className:"doc-residence principal-form-ellipsis",dangerouslySetInnerHTML:{__html:N}}),O.jsx("p",{dangerouslySetInnerHTML:{__html:`${c?`CI: ${c}`:G?`PA: ${G}`:Kg}`}}),O.jsx("p",{dangerouslySetInnerHTML:{__html:`TEL: ${S||Kg}`}}),T?O.jsx("a",{className:"principal-form-ellipsis",target:"_blank",href:`mailto:${T}?subject=${t} ${R} ${L}`,dangerouslySetInnerHTML:{__html:T}}):O.jsx("p",{children:Kg}),O.jsx("a",{target:"_blank",href:w,children:bq}),x?O.jsx("a",{target:"_blank",href:x,children:Nq}):O.jsx("p",{})]})},jre=({data:t,getData:e,slug:n,tabla:r,getPeople:a,titleSlug:i,setLoader:s})=>O.jsx(O.Fragment,{children:t.map(({fields:o,id:l})=>{const{primer_nombre:u,primer_apellido:c,correo_electronico:h,hash:f,email:p,clave:g,firstName:m,lastName:_}=o,x=p||h,E=u||m,y=c||_,I=Uq.includes(g)?"border-red-line":"",j=[l,E,y,x,f];return O.jsxs("div",{className:`each-doc-container ${I}`,name:j,children:[O.jsx(Vre,{fields:o,titleSlug:i}),O.jsx(Ure,{setLoader:s,tabla:r,slug:n,getData:e,getPeople:a,mail:x,hash:f})]},l)})}),zre=()=>{const{pathname:t}=da(),{slug:e}=Zd(),[n,r]=X.useState(null),[a,i]=X.useState(!1),s=e.replace("-"," ").toUpperCase(),o=e.replace("-","_"),l=ym.find(({base:p})=>p===o).id,{numberPeople:[u,c]}=X.useContext(yi),h=async()=>{const p=await o0(l,o,"sent","pending");r(p)},f=async()=>{c(null);const p=await o0(l,o,"isToday","TODAY");c(p.length>0?p.length:"")};return X.useEffect(()=>{r(null),h(),f()},[t]),O.jsxs(mb,{children:[O.jsx(Fb,{}),O.jsxs("div",{className:"validation-container",children:[O.jsx("h1",{className:"validation-title",children:s}),n&&u!==null&&!a?n.length>0?O.jsx(jre,{data:n,getData:h,getPeople:f,slug:o,tabla:l,titleSlug:s,setLoader:i}):O.jsx("h6",{className:"no-tramites",children:Tq}):O.jsx(ca,{isValidation:!0})]}),O.jsx(Tm,{})]})},qre=async(t,e,n,r,a,i,s,o,l)=>{t.preventDefault(),Ie.dismiss();let u=[];if(e.forEach(c=>{(!n[c.state]||n[c.state].trim()==="")&&u.push(c.title)}),u.length>0){Ie.error(`Faltan los siguientes campos: ${u.join(", ")}`);return}r(!0);try{const h=`00${+await uK(a,i,"numero_nota")+1}`,f={numero_nota:h,date:Gm(!0),email:s,...n},p=v3(f);await PN(a,i,p),o(h),l("")}catch(c){console.error("Error al enviar los datos:",c)}finally{r(!1)}},Gre=()=>{const[t,e]=X.useState(null),[n,r]=X.useState(""),[a,i]=X.useState(!1),{email:[s]}=X.useContext(yi),o="appxG342euC2AHDLj",l="numero_oficio";return O.jsxs(mb,{children:[O.jsx(Fb,{}),a?O.jsx(ca,{isValidation:!0}):O.jsxs("form",{className:"token-container",onSubmit:u=>qre(u,kw,n,i,o,l,s,e,r),children:[t&&O.jsx("p",{children:t}),kw.map(({title:u,state:c})=>O.jsxs("div",{className:"each-input each-input-note",children:[O.jsx("input",{type:"text",autoCapitalize:"off",autoCorrect:"off",autoComplete:"off",name:c,onChange:h=>w0(h,r)}),O.jsx("p",{className:"placeholder-input",children:u})]},u)),O.jsx("button",{className:"btn btn-success btn-val",children:Hz})]}),O.jsx(Tm,{})]})},Hre=()=>O.jsx(gF,{children:O.jsx(Sz,{children:O.jsxs(zq,{children:[O.jsx(Ere,{}),O.jsxs(uF,{children:[O.jsx(za,{path:"/documento/:slug",element:O.jsx(Bre,{})}),O.jsx(za,{path:"/",element:O.jsx(hK,{})}),O.jsx(za,{path:"/codigo",element:O.jsx(ane,{})}),O.jsx(za,{path:"/validation/:slug",element:O.jsx(zre,{})}),O.jsx(za,{path:"/login",element:O.jsx(ine,{})}),O.jsx(za,{path:"/:slug",element:O.jsx(yre,{})}),O.jsx(za,{path:"/numero-nota",element:O.jsx(Gre,{})}),O.jsx(za,{path:"*",element:O.jsx(Lm,{text:XE})})]}),O.jsx(fK,{})]})})});NI(document.getElementById("root")).render(O.jsx(X.StrictMode,{children:O.jsx(Hre,{})}))});export default Wre();